1 Want to turn on the `usedirs` setting on an existing wiki without breaking
4 #Apache and RewriteEngine
6 Here's a way to do it for Apache, using the
7 RewriteEngine. This example is for a wiki at the top of a web site, but can
8 be adapted to other situations.
11 RewriteCond $1 !^/~ # these pages
12 RewriteCond $1 !^/doc/ # are not part of
13 RewriteCond $1 !^/ajaxterm # the wiki, so
14 RewriteCond $1 !^/cgi-bin/ # don't rewrite them
15 RewriteCond $1 !.*/index$
16 RewriteRule (.+).html$ $1/ [R]
20 RewriteCond $1 !.*/index$
21 RewriteRule (.+).rss$ $1/index.rss
25 RewriteCond $1 !.*/index$
26 RewriteRule (.+).atom$ $1/index.atom
28 #lighttpd and mod_redirect
30 The following example is exactly the same thing written for lighttpd by using mod_redirect:
32 $HTTP["url"] !~ "^/(~|doc/|ajaxterm|cgi-bin/)" {
33 $HTTP["url"] !~ "^/(.*/index\.(html|rss|atom))" {
35 "(.*)\.html$" => "$1/",
36 "(.*)\.(atom|rss)$" => "$1/index.$2"