From: Greg Price Date: Thu, 12 Feb 2009 04:06:50 +0000 (-0500) Subject: import .htaccess, Anders' version X-Git-Url: https://sipb.mit.edu/gitweb.cgi/sipb-www.git/commitdiff_plain/6c318674e65d89e240bc4f938429e0501eb007fd?ds=sidebyside import .htaccess, Anders' version --- diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..247b755 --- /dev/null +++ b/.htaccess @@ -0,0 +1,30 @@ +# Disable CGI scripts and static-cat; serve everything as static content +# from Apache unless otherwise specified. + + SetHandler none + + +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]