Forum Moderators: phranque
RewriteEngine On
# This removes index.php from the URL, for cleaner URLs with the CMS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# Old blog redirect
Redirect 301 /blog/2010/06/28/david’s-favourites/ http://www.mywebsite.com/blog/david’s-favourites/
RewriteEngine on
#
# Externally redirect old blog URL to new blog URL
RewriteRule ^blog/2010/06/28/david[^s]+s-favourites/$ http://www.mywebsite.com/blog/david’s-favourites/ [R=301,L]
#
# Internally rewrite all requests for URLs which do not resolve to physical files or directories to
# the CMS script, as long as that script can generate content for those URLs. Note: This is a major
# efficiency tweak because it avoids unnecessary and very resource-intensive "exists" checks.
RewriteCond $1 !(^index\.php|(\.(gif|jpe?g|png|css|js)))$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
[edited by: jdMorgan at 2:39 pm (utc) on Aug 24, 2010]
# Externally redirect old blog URL to new blog URL
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /blog/2010/06/28/david\%[Ee]2\%80\%99s-favourites/\ HTTP/
RewriteRule ^blog/2010/06/28/david[^s]+s-favourites/$ http://www.mywebsite.com/blog/david’s-favourites/ [R=301,L]