1 [[!meta date="2007-04-11 01:17:05 +0000"]]
3 Want to turn on the `usedirs` setting on an existing wiki without breaking
6 #Apache and RewriteEngine
8 Here's a way to do it for Apache, using the
9 RewriteEngine. This example is for a wiki at the top of a web site, but can
10 be adapted to other situations.
13 RewriteCond $1 !^/~ # these pages
14 RewriteCond $1 !^/doc/ # are not part of
15 RewriteCond $1 !^/ajaxterm # the wiki, so
16 RewriteCond $1 !^/cgi-bin/ # don't rewrite them
17 RewriteCond $1 !.*/index$
18 RewriteRule (.+).html$ $1/ [R]
22 RewriteCond $1 !.*/index$
23 RewriteRule (.+).rss$ $1/index.rss
27 RewriteCond $1 !.*/index$
28 RewriteRule (.+).atom$ $1/index.atom
30 #lighttpd and mod_redirect
32 The following example is exactly the same thing written for lighttpd by using mod_redirect:
34 $HTTP["url"] !~ "^/(~|doc/|ajaxterm|cgi-bin/)" {
35 $HTTP["url"] !~ "^/(.*/index\.(html|rss|atom))" {
37 "(.*)\.html$" => "$1/",
38 "(.*)\.(atom|rss)$" => "$1/index.$2"