473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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?

Jun 12 '07 #1
2 1488
RSH
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

"ITistic" <sh***@itistic.comwrote in message
news:11**********************@a26g2000pre.googlegr oups.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
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?

Jun 12 '07 #2
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)
ITistic wrote:
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?
Jun 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Papa.Legba.666 | last post by:
There are many good HTML validators, not least, of course being w3c's. However, they only handle one page at a time. Is there a free web based served, or pc program, which will crawl my site...
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
1
by: Osama Sayed | last post by:
I have a class that implements IHttpModule to handle URLs with a "RESTful" nature. It handles them according to a custom configuration section in the website's Web.Config file. My questions are:...
21
by: John | last post by:
Hi, I updated a site and changed the file extensions from .html to .php. Now i noticed that the google does find the old .html pages but since they're not there anymore... they can't be found....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.