g1smd:
Rule order optimised, added escaping in patterns, added non-www to www canonicalisation, and rewrite re-coded for better server efficiency:
SSU SetUp
Options +FollowSymLinks -MultiViews
RewriteEngine On
Deny access to .htaccess
RewriteRule ^.htaccess$ - [F]
The "/" is the default value so remove the following line
RewriteBase /
Custom Redirects
RewriteRule ^index.html$ http://www.example.com/ [R=301,L]
RewriteRule ^shop/CategoryB$ http://www.example.com/CategoryC [R=301,L]
RewriteRule ^shop/CategoryB/CategoryB-(.)$ http://www.example.com/CategoryC/CategoryC-$1 [R=301,L]
RewriteRule ^shop(/index.html)?$ http://www.example.com/shop/ [R=301,L]
RewriteRule ^shop/(.)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^(www.example.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
SSU Rewrite
RewriteCond %{REQUEST_URI} !.(jpe?g|gif|png|css|js|zip)$
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA]
>
> Every change is important, right down to the last slash and dot.
Wow :clap:
So, I should remove the: "RewriteBase"?
On the following line, should it not re-direct to the mainsite instead of the /shop/ folder, since I moved the store out of that directory to the main folder?