How to use mod_rewrite to redirect a URL
Posted on 2014-12-22
I'm trying to find the best way of accomplishing the following:
I have 2 separate web servers, let's call them abc.com and xyz.com.
The server hosting xyz.com is being decommissioned, but there are still active links pointing to it that my customers may continue to use.
Some of the customer links point directly to a perl script with embedded variables, something like this:
Once I point the xyz.com domain to the server hosting abc.com, I'd like the above URL to be redirected to:
It makes no difference to me whether the end users sees the change in domain name, but I don't want them to get an SSL warning or error.
Is the best way to handle this to use a rewrite rule, an alias, or some other method? Please be as specific as possible with rewrite rules -- my skills are beginner in using mod_rewrite.