Thanks for your quick reply.
With the suggested code, in spite of DirectoryIndex directive, the index files won't work in neither the root, nor in the additional folders in root.
With the lines commented out. The index worked in the root/catalog folder, but not in the excluded folders in the root dir.
Should I add the DirectoryIndex to additional .htaccess files in the respective subfolders?
So close and yet so far
- Code: Select all
Options +FollowSymLinks
DirectoryIndex index.php index.html index.htm
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^catalog(/(.*))?$ http://www.merseysite.com/$2 [R=301,L]
RewriteCond %{HTTP_HOST} ^(merseysite\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
#RewriteCond %{ENV:REDIRECT_STATUS} ^$
#RewriteCond %{HTTP_HOST} ^(www\.)?merseysite\.com$ [NC]
#RewriteCond %{SCRIPT_FILENAME} !-f
#RewriteRule !^(folders|to|ignore)(/.*)$ /catalog%{REQUEST_URI} [QSA,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?merseysite\.com$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /catalog/$1 [QSA,L]