Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Migrating static site to ASP.NET - How to handle redirecting old URLs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ITistic - 12 Jun 2007 21:24 GMT
I am about to start on a migration from a static HTML site to an
ASP.NET solution. I've done a ton of these in the past as my primary
job duty is developing ASP.NET sites. This is the first project I've
come across for a site that has quite a few .HTM pages with good
search engine ranking. I want to make sure I do everything I can to
retain those rankings at least as far as the URLs are concerned. What
I want to do is make sure that when an old .HTM URL is requested that
the system 301 redirects to the equivalent ASP.NET page. My initial
thought is to create a database table of all the OLD virtual URLs
(ex: /products/product1/index.htm) and the new ASP.NET URL that they
should be redirected to. I could then set ASP.NET to process .HTM
pages and use a custom 404 handler to perform the redirection. Is this
the best way? Even if you think it is, what other solutions have you
used that may be easier or better?
RSH - 12 Jun 2007 22:26 GMT
I have used redirects in IIS as well as custom redirects in the Global.asax
file basically error trapping the page not found error and forwarding them
to the new page.

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

strErr = Server.GetLastError.ToString()

If InStr(strErr, "System.IO.FileNotFoundException:") > 0 Then

If InStr(UCase(strErr), "\SERVICES\") > 0 Then

Response.Redirect("/EmployerSolutions_Main.aspx")

ElseIf InStr(UCase(strErr), UCase("\About\")) > 0 Then

Response.Redirect("/About.aspx")

ElseIf InStr(UCase(strErr), UCase("\Accountants\")) > 0 Then

Response.Redirect("/IndustrySolutions_AccountingProfessionals.aspx")

End Sub

>I am about to start on a migration from a static HTML site to an
> ASP.NET solution. I've done a ton of these in the past as my primary
[quoted text clipped - 10 lines]
> the best way? Even if you think it is, what other solutions have you
> used that may be easier or better?
bruce barker - 12 Jun 2007 22:50 GMT
just map .htm to asp.net and keep the same file names. there is nothing
really special about using .aspx, it just a convention

-- bruce (sqlwork.com)

> I am about to start on a migration from a static HTML site to an
> ASP.NET solution. I've done a ton of these in the past as my primary
[quoted text clipped - 10 lines]
> the best way? Even if you think it is, what other solutions have you
> used that may be easier or better?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.