I think I have found every variable possible, even trying to figure out the variables, but we are moving domains (olddomain.com) over to newdomain. All the clients have their own prefix, so company1.olddomain.com works. We have newdomain.com setup.
The codebase is the same, I have separate vhosts for logging, I just want to say;
redirect company1.olddomain.com -> company1.newdomain.com. I cant search for company1 as we have hundreds, so just want to say ;
*.olddomain.com redirect to $1.newdomain.com
Every variable keeps dumping me at newdomain.com root.
Thanks for such a simple but annoying question.
I have the following;
Quote:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://$1.newdomain.com [R=301,L]
|
That does redirect but to simply
.newdomain.com
So it really just seems to need the variable for the prefix which I cant find. I reconfirmed by sticking the rule to say RewriteRule ^(.*)$
http://x.newdomain.com [R=301,L]
and sure enough the browser redirects to
http://x.newdomain.com so I just need the first part of the %{HTTP_HOST} I believe.