Dropping the .html suffix

i want to enable my users to drop the “.html” suffix.

so if they were to enter:



i’d want them taken to:



and of course i’d want that to generalize to any file.

it looks like i do this with mod_rewrite in my .htaccess file?

currently (and this must be the default), it looks like this:

Order Allow,Deny
Deny from All


some googling indicates this might work?

[quote]RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]


i’m not sure what the “l” flag does?
but will this work to do what i want?

thanks so much…


You don’t even need mod_rewrite for this. In your root-level .htaccess file, place this line:

Options Multiviews Note that you want to avoid having files with similar names if you do this (eg, cats.html and cats.jpg).

Read about Apache content negotiation for more information.

If you want useful replies, ask smart questions.