RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ $1 [R,L] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule (.*) $1.php [L] RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule (.*) $1.html [L]