2007-04-11 03:17:05 +02:00
|
|
|
Want to turn on the `usedirs` setting on an existing wiki without breaking
|
2007-05-13 10:30:53 +02:00
|
|
|
all the links into it?
|
|
|
|
|
|
|
|
#Apache and RewriteEngine
|
|
|
|
|
|
|
|
Here's a way to do it for Apache, using the
|
2007-04-11 03:17:05 +02:00
|
|
|
RewriteEngine. This example is for a wiki at the top of a web site, but can
|
|
|
|
be adapted to other situations.
|
|
|
|
|
|
|
|
# pages
|
2007-04-11 03:18:36 +02:00
|
|
|
RewriteCond $1 !^/~ # these pages
|
|
|
|
RewriteCond $1 !^/doc/ # are not part of
|
|
|
|
RewriteCond $1 !^/ajaxterm # the wiki, so
|
|
|
|
RewriteCond $1 !^/cgi-bin/ # don't rewrite them
|
2007-04-11 03:17:05 +02:00
|
|
|
RewriteCond $1 !.*/index$
|
2007-04-15 09:20:29 +02:00
|
|
|
RewriteRule (.+).html$ $1/ [R]
|
2007-04-11 03:17:05 +02:00
|
|
|
|
|
|
|
# rss feeds
|
|
|
|
RewriteCond $1 !^/~
|
|
|
|
RewriteCond $1 !.*/index$
|
2007-04-15 09:20:29 +02:00
|
|
|
RewriteRule (.+).rss$ $1/index.rss
|
2007-04-11 03:17:05 +02:00
|
|
|
|
|
|
|
# atom feeds
|
|
|
|
RewriteCond $1 !^/~
|
|
|
|
RewriteCond $1 !.*/index$
|
2007-04-15 09:20:29 +02:00
|
|
|
RewriteRule (.+).atom$ $1/index.atom
|
2007-05-10 21:48:34 +02:00
|
|
|
|
2007-05-13 10:30:53 +02:00
|
|
|
#lighttpd and mod_redirect
|
|
|
|
|
2007-05-10 21:48:34 +02:00
|
|
|
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"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|