apache rewrite keep wildcard prefix change domain
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:
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. |
Hi,
You can use: Code:
RewriteEngine On |
Now that is something I will never forget! I have looked everywhere for those variables, and I knew some genius would just say oh it's %1 !!!!
Thanks so much, worked perfect! |
All times are GMT -5. The time now is 08:36 AM. |