Search code examples
phphttp-redirecthttp-status-code-301

How long do I need to maintain old URLs?


Ok, I know it is best practice that once you change or remove a page URL, to redirect that url to the new relevant URL.

But for how long? forever?

For example, I am using Google website optimizer to test different variations of a page. So I have to create a different url for each like: original.php, var1.php, var2.php, etc.

once the test is done, the winner will become the new original.php and there will be no need to keep var1.php, etc. But I now need to redirect those no longer needed URL's to the relevant original.php.

This can end up being a ALOT of 301 redirects in my .htaccess file. I also have heard that the more stuff you have in your .htaccess file the slower your site becomes because the server has to process everything in it before it can serve a page.

I can move the redirects to the actual URLs (example a php redirect on the actual var1.php file) but then I have several unneeded files bloating up my server.

So I am wondering whats the best practice here? is it safe to remove a 301 redirect after so long?


Solution

  • You can check your web server's access logs for the 301 redirects on those URLs. When they no longer appear in the logs (or appear very rarely), you can remove the redirects if you feel like it. There is no particularly best time to remove them. The "best" time is when the old URLs are no longer used, and that can differ a lot from site to site.