]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/tips/redirections_for_usedirs.mdwn
web commit by http://harningt.myopenid.com/: IRC discussion about usage semantics
[ikiwiki.git] / doc / tips / redirections_for_usedirs.mdwn
index 51a73a7ad310379f479b74b0025f6158d6cd0ade..588b9f4b5438aece4b40ac9c15a991597967215c 100644 (file)
@@ -1,5 +1,9 @@
 Want to turn on the `usedirs` setting on an existing wiki without breaking
-all the links into it? Here's a way to do it for Apache, using the
+all the links into it?
+
+#Apache and RewriteEngine
+
+Here's a way to do it for Apache, using the
 RewriteEngine. This example is for a wiki at the top of a web site, but can
 be adapted to other situations.
 
@@ -20,3 +24,16 @@ be adapted to other situations.
        RewriteCond $1 !^/~
        RewriteCond $1 !.*/index$
        RewriteRule (.+).atom$ $1/index.atom
+
+#lighttpd and mod_redirect
+
+The following example is exactly the same thing written for lighttpd by using mod_redirect:
+
+    $HTTP["url"] !~ "^/(~|doc/|ajaxterm|cgi-bin/)" {
+      $HTTP["url"] !~ "^/(.*/index\.(html|rss|atom))" {
+        url.redirect = ( 
+          "(.*)\.html$" => "$1/",
+          "(.*)\.(atom|rss)$" => "$1/index.$2"     
+        )
+      } 
+    } 
\ No newline at end of file