Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How do you remove a .html extension or any extension using an .htaccess file?

share|improve this question

migrated from Dec 10 '09 at 14:01

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Google is your friend :-)

Take a look at this article.


RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html


share|improve this answer
Agreed - just make sure that mod_rewrite is enabled and the above snipped should do what you need. – EEAA Dec 10 '09 at 16:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.