]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/tips/redirections_for_usedirs.mdwn
web commit by http://ressukka.net/: Add an example of redirecting with lighttpd
[ikiwiki.git] / doc / tips / redirections_for_usedirs.mdwn
index b6e85aac80ab771d7a00ffe75e16c88cf061582e..2913691f0c27a4df7f933afa17dbd00f0b23e25f 100644 (file)
@@ -9,14 +9,25 @@ be adapted to other situations.
        RewriteCond $1 !^/ajaxterm   # the wiki, so
        RewriteCond $1 !^/cgi-bin/   # don't rewrite them
        RewriteCond $1 !.*/index$
-       RewriteRule (.+).html $1/ [R]
+       RewriteRule (.+).html$ $1/ [R]
        
        # rss feeds
        RewriteCond $1 !^/~
        RewriteCond $1 !.*/index$
-       RewriteRule (.+).rss $1/index.rss
+       RewriteRule (.+).rss$ $1/index.rss
        
        # atom feeds
        RewriteCond $1 !^/~
        RewriteCond $1 !.*/index$
-       RewriteRule (.+).atom $1/index.atom
+       RewriteRule (.+).atom$ $1/index.atom
+
+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