Forum Moderators: phranque

Message Too Old, No Replies

Using Rewrite Maps for 50,000 URLs

         

Uber_SEO

8:45 am on Aug 13, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi there. I'm migrating my personal consumer review website. It has approximately 50,000 URLs on it. For reasons that I don't / can't go in to, the URLs will be changing in an unpredictable manner, meaning that if I want to do page to page redirects, I will have to produce 50,000 rewrite rules with the .htaccess. I'm obviously concerned on the impact that that would have on the server, so one of the options I've explored is the use of rewrite maps. Does anyone have experience using rewrite maps at this scale? Is this likely to work. The site gets moderate to heavy server load. Do you think I'll have performance issues?

lucy24

6:27 pm on Aug 13, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can't use RewriteMaps in htaccess. Well, that's not technically correct. You can use a RewriteMap, but you can't declare one; that can only be done in the config file. Is it your own server? If so, a RewriteMap is one option. Another -- which can be done anywhere -- is something like

RewriteRule blahblah /fixup.php [L]

This rule goes in the section of your RewriteRules that deals with external redirects; typically it would go after any specific rules (if you've still got them) but before the generic ones like index.html and hostname. The "blahblah" part should be constrained as narrowly as possible: at a minimum, make it only apply to requests for pages, assuming your images and stylesheets haven't moved. If the old and new URLs have different structures, such as different numbers of directories or different characters used in the names, write that into the rule. This would also apply to a RewriteMap approach: don't even look at the map unless the request is for an old-style page URL.

Either way, you definitely do not want 50,000 individual redirects!