Forum Moderators: phranque
RewriteEngine On
RewriteRule ^(.*)/$ /$1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.parkat.co.uk/$1/ [R=301,L]
RewriteEngine on
#
# Externally redirect direct client requests for script filepaths back to "friendly" extensionless URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]*/)*[^.]+\.php([?#][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*[^.]+)\.php$ http://www.parkat.co.uk/$1/ [R=301,L]
#
# Externally redirect to add missing trailing slashes to extensionless URL requests
RewriteCond $1 !\.[a-z]+[0-9]?$
RewriteRule ^(.*[^/])$ http://www.parkat.co.uk/$1/ [R=301,L]
#
# Externally redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} !^www\.parkat\.co\.uk$
RewriteRule ^(.*)$ http://www.parkat.co.uk/$1 [R=301,L]
#
# Internally rewrite all requests ending with slash to php scripts
RewriteRule ^(.*)/$ /$1.php [L]
GET /dir123/file2323.php?parm1=abc&parm2=def#TOP HTTP/1.1
[edited by: jdMorgan at 3:00 am (utc) on Feb 18, 2011]