I’m about to replace a current e-commerce site with a brand new site. Before, a URL to a product was like this: http://www.example.com/ProductDetails.aspx?ProductID=123
Now it is like this: http://www.example.com/en-us/product/123/The-greatest-product-in-the-world
My question is: Should the 301 permanent redirect be done in the Application_BeginRequest event of Global.asax or in the Page_Load of my 404 error page? Isn’t too late to make a 301 when the 404 loads?
You’ll want to do it before the browser (or bot) gets the 404 error. That way you make sure search engine bots are going to properly re-index your product pages and any page rank associated with them.