Source

freehg / htdocs / .htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^static/style-gitweb.css$ /static/style.css [L]
RewriteRule ^static/ - [L]
RewriteRule ^adminmedia/ - [L]
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]

RewriteRule ^(hgfcgi/dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(dispatch\.fcgi/.*)$ - [L]

RewriteCond %{HTTP_USER_AGENT} ^mercurial.*
RewriteRule ^(u/.+)$ hgfcgi/dispatch.fcgi/$1 [L]

RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/?)$ dispatch.fcgi/$1 [L]
RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/edit/?)$ dispatch.fcgi/$1 [L]
RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/delete/?)$ dispatch.fcgi/$1 [L]

RewriteRule ^(u/\w+/\w(\w|-|\.)+\w/.+)$ hgfcgi/dispatch.fcgi/$1 [L]

RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]