web commit by http://ressukka.net/: Add an example of redirecting with lighttpd
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 10 May 2007 19:48:34 +0000 (19:48 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 10 May 2007 19:48:34 +0000 (19:48 +0000)
doc/tips/redirections_for_usedirs.mdwn

index 51a73a7ad310379f479b74b0025f6158d6cd0ade..2913691f0c27a4df7f933afa17dbd00f0b23e25f 100644 (file)
@@ -20,3 +20,14 @@ be adapted to other situations.
        RewriteCond $1 !^/~
        RewriteCond $1 !.*/index$
        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