301 Redirect ASP.NET

This will have to be part one of two entries.  I am about to start migrating a few rather large DotNetNuke sites to ASP.NET 2.0 and I want to make sure that any links people have to the pages are handled corrrectly.  The best way I think to do this is the set up a 301 Redirect handler, of course using URLMapping, but to let the search engines know it has been redirected, I need to pass the 301 code and the new URL to the spider.

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code '301' is interpreted as 'moved permanently'.

You can Test your redirection with Search Engine Friendly Redirect Checker

Here are some ways you can handle the code to pass a 301 redirect in ASP.NET and IIS:

IIS Redirect
In internet services manager, right click on the file or folder you wish to redirect
Select the radio titled 'a redirection to a URL'.
Enter the redirection page
Check 'The exact url entered above' and the 'A permanent redirection for this resource'
Click on 'Apply'

Redirect in ASP
   Response.Status='301 Moved Permanently' Response.AddHeader 'Location', ' http://www.new-url.com'

Redirect in ASP .NET
private sub Page_Load(object sender, System.EventArgs e)

   Response.Status = '301 Moved Permanently'

end sub

I will make another entry later this week about how to create a handler, most likely one that leverages the code for the URLMapping handler I posted about the other day.

Share This Article With Your Friends!