--- /dev/null
+# Disable CGI scripts and static-cat; serve everything as static content
+# from Apache unless otherwise specified.
+<Files *>
+ SetHandler none
+</Files>
+
+RewriteEngine On
+RewriteBase /
+
+# Redirect /iap to stuff.mit.edu/iap
+RewriteRule ^iap(/.*)?$ http://stuff.mit.edu/iap$1 [R,L]
+
+# Serve some CGI scripts from _wiki-cgi
+RewriteRule ^ikiwiki.cgi$ _wiki-cgi/ikiwiki.cgi [L]
+RewriteRule ^update.cgi$ _wiki-cgi/update.cgi [L]
+
+# Trailing-slash directories served from _wiki
+RewriteCond %{DOCUMENT_ROOT}/_wiki%{REQUEST_URI} -d
+RewriteRule ^(.*[^/])$ $1/ [R=permanent,L]
+
+# Serve most content from _wiki
+RewriteCond %{DOCUMENT_ROOT}/_wiki%{REQUEST_URI} -d [OR]
+RewriteCond %{DOCUMENT_ROOT}/_wiki%{REQUEST_URI} -f
+RewriteRule ^(.*)$ _wiki/$1 [L]
+
+# Strip obsolete /wiki from URLs
+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]