|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# Disable directory indexes and MultiViews Options -Indexes -MultiViews # Prevent mod_dir appending a slash to directory requests DirectorySlash Off RewriteEngine On # Rewrite /foo to /foo.html if it exists RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html -f RewriteRule !\.\w{2,4}$ %{REQUEST_URI}.html [L] # Otherwise, rewrite /foo to /foo/index.html if it exists RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}/index.html -f RewriteRule !\.\w{2,4}$ %{REQUEST_URI}/index.html [L] # Handling 404 ErrorDocument 404 /404.html |