RewriteRule - Doesn't work on live site - subfolder to new domain
- by eb_Dev
I have the following rule on my local dev site and it works fine:
RewriteCond %{HTTP_HOST} ^localhost$
RewriteRule ^subdomains/example.com(.*) http://www.example.com$1 [R=301,L]
However when I change it to:
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^subdomains/example.com(.*) http://www.example.com$1 [R=301,L]
and upload it to my live site it doesn't work, if i change the rule to:
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^subdomains/(.*) http://www.example.com$1 [R=301,L]
the rule functions as expected and directs an url beginning with www.domain.com/subdomains/ to www.example.com/.
Does anyone know what is going on here?
Thanks for you help.