Forum Moderators: phranque
http://www.domain.co.uk/blog/123/?q=blog/blog/123 Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain\.co.uk [NC]
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
DirectoryIndex index.php
#301 redirects
redirect 301 /blog/abc http://www.domain.co.uk/blog/123/?
redirect 301 /blog/def http://www.domain.co.uk/456/?
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain\.co.uk [NC] RewriteCond %{HTTP_HOST} !^(www\.domain\.co\.uk)?$ RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] http://www.domain.co.uk/blog/123/?q=blog/blog/123 instead of the intended http://www.domain.co.uk/blog/123 ?q=blog/blog/123
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^blog/abc$ http://www.domain.co.uk/blog/def? [R=301,L]
# non www to www redirect
RewriteCond %{HTTP_HOST} !^(www\.domain\.co\.uk)?$
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
#remove trailing slash
RewriteRule ^(.+)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
DirectoryIndex index.php
this directory has a .htaccess file that switches the rewrite engine off