Im building a small webshop and have run into a problem. The company which im building this webshop for has a lot of old SEO links pointing to products and categories. They, of course, do not want to loose these inbound links and still want value from them. I need to catch an inbound link e.g. http://www.myshop.com/myproduct.html and relay it with a HTTP 301 to e.g. http://www.myshop.com/products/ShowProduct/42
Any ideas on how to do this, i did this before in a asp.net webforms with a generic handler, that intercepted all calls, but i cant seem to get that to work.. I need to do this in code, i dont have access to the IIS since its a web hotel. I know all the inbound links.
You could implement the
Application_BeginRequestmethod to intercept all requests. In this method you can test on theRequest.Urlproperty to determine what to do.Something like this (in Global.asax.cs):
This will redirect all requests to *.html to /MyUrl/