Accept PATH_INFO on gitweb.cgi
[sipb-www.git] / .htaccess
index 247b755afd43384e5845529a3fa062b5cb9a5974..37325c0d75743bbab67acd38b42500e0d0b057ff 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -7,12 +7,15 @@
 RewriteEngine On
 RewriteBase /
 
-# Redirect /iap to stuff.mit.edu/iap
-RewriteRule ^iap(/.*)?$ http://stuff.mit.edu/iap$1 [R,L]
+# Canonicalize on sipb.mit.edu
+RewriteCond %{HTTP_HOST} !^sipb.mit.edu$ [NC]
+RewriteCond %{HTTPS} !=on
+RewriteRule ^(.*)$ http://sipb.mit.edu/$1 [R=301,L]
 
 # Serve some CGI scripts from _wiki-cgi
 RewriteRule ^ikiwiki.cgi$ _wiki-cgi/ikiwiki.cgi [L]
 RewriteRule ^update.cgi$ _wiki-cgi/update.cgi [L]
+RewriteRule ^gitweb.cgi(/.*)?$ _wiki-cgi/gitweb.cgi$1 [L]
 
 # Trailing-slash directories served from _wiki
 RewriteCond %{DOCUMENT_ROOT}/_wiki%{REQUEST_URI} -d
@@ -28,3 +31,6 @@ RewriteRule ^wiki(/.*)?$ $1 [R=permanent,L]
 
 # Redirect old /doc/wiki to sipb-www.scripts
 RewriteRule ^doc/wiki(/.*)?$ http://sipb-www.scripts.mit.edu/doc/wiki$1 [R,L]
+
+# Give a better error page for 404s
+ErrorDocument 404 /_wiki-cgi/ikiwiki.cgi