RewriteRule - Doesn't work on live site - subfolder to new domain
        Posted  
        
            by eb_Dev
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by eb_Dev
        
        
        
        Published on 2010-05-13T09:12:07Z
        Indexed on 
            2010/05/13
            9:14 UTC
        
        
        Read the original article
        Hit count: 275
        
htaccess
|rewriterule
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.
© Stack Overflow or respective owner