This topic contains 6 replies, has 1 voice, and was last updated by Roelof Kramer .
Any tips for doing a ton of 301 redirects. Rebuilding a large eCommerce site which had virtually no link structure.. Resulting in 500+ redirects. Is this too many for htaccess?
You should add them to the server. What server are you on Apache or NGINX?
No, it’s not too many for .htaccess.
Good article w real experimental data: quantity of redirects causing issues
I’d suggest considering some (or all) of the following;
As recommended in the Apache Documentation, consider avoiding .htaccess files entirely and instead use the httpd.conf server configuration file to add your directives.
If you must use .htaccess files, always look for patterns. Try and combine multiple rules into one. Acquaint yourself with the RewriteRule directive and the basics of regex.
If your site doesn’t have patterns which can easily be mapped by a regex rule, then consider using a rule to rewrite legacy URLs to a router script of some form, maintain a map of old to new URLs somewhere, and handle the 301 redirect in code instead of letting the server do it.
Take some time to review your hosting infrastructure; run some load tests using something like LoadImpact, and consider caching 301 responses in your caching layer.
I use to have over 5million 301s in my htaccess back in 2006 with an affiliate site. I use to upload 5million + all genuine looking products to Froogle shopping Engine. leave them there for a few days then switch on my htaccess with the 5m directs. pages use to take about 20 seconds TTFB but i did not care. The money was rolling in till they shut down Froogle. I still believe I am the cause of Froogle being terminated lol. Those where the days… But as it shows in the article, htaccess files does impact the TTFB
Thanks everyone! Ended up doing it through the server – not on htaccess.
Never ever do 301 internal directs, you need to fix the links. 301’s slow the load time considerably. Use the 301 rules for external links but for internal you must fix the links or suffer the slow loading of the site. The quickest way to fix them all is by downloading the database, open it in notepad++ and do a find and replace for each link one by one, then upload the database and all should be good.
You must be logged in to reply to this topic.