Rule order optimised, added escaping in patterns, added non-www to www canonicalisation, and rewrite re-coded for better server efficiency:
Code:
# 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]
# Canonical Redirect to www.example.com
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.
Bookmarks