The other day I tried making my html pages into pretty urls with the [.htaccess] code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
This worked for my html pages fine, but when I went to parts of my site that use php (specifically my SMF forum) did not work. Is there anyway I can make this code work for only .html files, and ignore all other php files?
You must check for existence of .html
file for adding .html
in a URI:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]