Odd .htaccess Problem
Posted: Thu May 21, 2009 11:39 am
I have a site with some html files on it. One of them is contact.html. This is my .htaccess, and I'm having problems where I can address the page with http://site.com/contact, but not http://site.com/contact/. (Note ending slash.) What's the fix?
Code: Select all
RewriteEngine On
# If the requested URI does not contain a period in the final path-part
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
# and if it does not exist as a directory
RewriteCond %{REQUEST_fileNAME} !-d
# and if it does not exist as a file
RewriteCond %{REQUEST_fileNAME} !-f
# then add .html to get the actual filename
rewriterule (.*) /$1.html [L]