Mass 301 redirects to ASP.NET including pages that need to be redirected elsewhere depending on query string parameters

We have several pages on our site indexed using old non-SEO URLs like http://www.domain.com/DocumentDetails.aspx?id=555 . We recently implemented routing that uses the bullets stored in the database and looks at the pool to redirect you to the correct page using routing, for example: http://www.domain.com/Documents/Title-of-the-Document

That's all well and good, however we are having a hard time finding a better way to set up our 301 permalinks for all links that are currently indexed by Google.

Is there a way to have 1 centralized place to store the old url and the new url and will it automatically redirect 301 when a record is found, and also treat different query string parameters as different records? We are using IIS6 and Server 2003.

Thank!

+2


source to share


1 answer


Add a CustomRouteHandler for your old page, which can do a 301 for your new url:



//look up new url and do the 301
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com/"); 

      

+2


source







All Articles