I have been trying to get this to work on my client\'s server for a website I am developing, but I simply cannot get it to work. Basically I am trying to remove the .html ex
Explanation: http://eisabainyo.net/weblog/2007/08/19/removing-file-extension-via-htaccess/
Example:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html
# Forces a trailing slash to be added
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
Then, all hyperlinks, css links, images, etc, will need to be updated to have either an absolute URL (http://www.site.com/style.css
) or relative and begin with ../
. Otherwise you will encounter issues such as CSS that doesn't load, links that don't work, etc.