DirectoryIndex index.html

# Prevent mod_dir appending a slash to directory requests
DirectorySlash Off

# Prevent any further processing if the URL already ends with a file extension
RewriteRule \.\w{2.4}$ - [L]

# Redirect any requests to remove a trailing slash
RewriteRule (.*)/$ /site/v3/$1 [R=301,L]

# Rewrite /foo to /foo.html if it exists
RewriteCond %{DOCUMENT_ROOT}/site/v3/$1.html -f
RewriteRule (.*) /site/v3/$1.html [L]

# Prevent direct home's html access
RewriteRule index.html$ / [R=301,L]

ErrorDocument 404 /site/v3/404.html
