I have installed opencart in two folders – one is root folder i.e. ‘public_html/’ and one is ‘public_html/test/’. Both opencart contains .htaccess files.
The .htaccess file of opencart on ‘public_html/’ folder contains following rewrite rules:
RewriteBase /
RewriteRule sitemap.xml /new/index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^abcd\.co\.in
RewriteRule (.*) http://www.abcd.co.in/$1 [R=301,L]
and the .htaccess file of opencart on ‘public_html/test/’ folder contains following rewrite rules:
RewriteBase /test/
RewriteRule sitemap.xml /new/index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
The problem is When i open Domain http://abcd.co.in it will redirect to http://www.abcd.co.in, but when i open http://abcd.co.in/test
it is not redirecting
If You hit the URL
the
.htaccessfile frompublic_htmlroot folder is not taken into count if You have another.htaccessfile in thepublic_html/test/folder. You should extend thepublic_html/test/.htaccessthis way:This should do the trick.