I have been working on this for ages but cannot get it to work.
Basically I am trying to this:
XXX.YYY.com/ZZZ => www.hostdomain.com/?d=YYY&s=XXX&f=ZZZ
eg site.newdomain.com/foldername/ => www.hostdomain.com/?d=newdomain&s=sitename&f=foldername
'www' in front needs to be handled also. I use proxy redirect as I want the user to still see XXX.YYY.com/ZZZ in their browser.
I am sure this can be done with a simple rewrite statement.
This is where I am at:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+\.[^\.]+)$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+\.[^\.]+)$ [NC]
RewriteRule ^(.*)$ http://www\.hostdomain\.com/?d=%2&s=%1&f=$1 [P,L]
This does not work... any help is greatly appreciated!!