DirectoryIndex index
Options +MultiViews
ForceLanguagePriority Fallback
AddDefaultCharset utf-8
AddHandler cgi-script .pl
RewriteEngine On
# Fix some paths internally.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_FILENAME} ^(.*)\.([^.]+)$
RewriteCond %1 -d
RewriteCond %1 !-f
RewriteRule (.*) http://%{HTTP_HOST}/$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteCond %{REQUEST_FILENAME} ^(.*)\.([^.]+)$
RewriteCond %1 -d
RewriteCond %1 !-f
RewriteRule .* %1/index.%2
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)/$ $1/index
RewriteCond %{REQUEST_URI} =/
RewriteRule .* index
# Let the language really fall back in some cases (so that no dead
# links are generated because a document's language is not available,
# will then re-check that by parsing users choices again).
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.xhtml !-f
RewriteCond %{REQUEST_FILENAME} ^(.*)\.([^./]+)$
RewriteRule ^(.*)\.[^.]+$ http://%{HTTP_HOST}/$1 [R=307,L]
# Set the content type for IE to text/html. It is the only client I ever
# saw that does NOT support application/xhtml+xml.
RewriteCond %{HTTP_USER_AGENT} MSIE
RewriteCond %{REQUEST_URI} \.xhtml$
RewriteRule .* - [T=text/html;charset=utf-8]
# Rewrite moved URLs.
RewriteRule ^/gtk4vc\.zip http://%{HTTP_HOST}/gtk/packages-for-msvc.zip [R=301,L]
# Make sure some clients don't select the raw XML files,
# if any. (Will be replaced until I know how to select XML files only when explicitly
# requested with full ending.
<Files *.xml>
Deny from all
</Files>