apache - htaccess redirect not working in Chrome or other browsers -
i hosting separate site in subfolder. rules have set in .htaccess file follows:
rewritecond %{http_host} www.example.com rewritecond %{http_host} example.com rewritecond %{request_uri} !subfolder/ rewriterule ^(.*)$ subfolder/$1 [l]
this works fine in firefox (example.com redirects www.example.com), not in other browser.
any idea doing wrong? i've cleared cache, etc., problem persists.
update
i apologize, should have explained better. there 2 sites here, 1 main folder , 1 subfolder. full htaccess file below.
rewriteengine on rewritecond %{http_host} ^mainsite.com [nc] rewriterule ^(.*)$ http://www.mainsite.com/$1 [r=301,nc] rewritecond %{http_host} www.secondarysite.com rewritecond %{http_host} secondarysite.com rewritecond %{request_uri} !subfolder/ rewriterule ^(.*)$ subfolder/$1 [l]
the first chunk main site, second secondary site, pointing subfolder.
try keep 1 condition , tell me if worked :
rewriteengine on rewritecond %{http_host} !^(www\.example\.com)?$ rewriterule ^(.*)$ http://www.example.com/$1 [r=301]
then add lines :
rewritecond %{request_uri} !subfolder/ rewriterule ^(.*)$ subfolder/$1 [l]
Comments
Post a Comment