0

I’m working for a client who has requested to change a massive amount of urls, around 500, and then have redirects from old to new. Basically going from:

online.XXX.com/XXX

To

example.com/estore/XXX

I’m concerned that this will create a time lag on the page load. Every time a url is requested the server has to do a look up through everyone of these redirects to check if it needs to send the traffic elsewhere.

Would it not be possible to use a more ‘compact’ rule and redirect the domains? Something like:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://www.example.com/estore/$1 [R=301,L]

Would this work? This would then be a catch all for every older url.

However would this rule then try and force the non e-commerce pages to the /estore/ url? How do I change the catch all (.*) to only include the online.XXX.com/ urls?

Thanks

  • _"How do I change the catch all (.*) to only include the online.XXX.com/ urls?"_ - RewriteRule matches against the path component of the URL only. You need to put a RewriteCond before the rule, that checks on the host name. – CBroe Apr 14 '23 at 11:12
  • CBroe, thanks for the reply, could you provide an example fo the RewriteCond rule? – user1794875 Apr 14 '23 at 14:57
  • https://stackoverflow.com/q/10232722/1427878 – CBroe Apr 17 '23 at 05:56

0 Answers0