]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/tips/redirections_for_usedirs.mdwn
web commit by http://willthompson.co.uk/: Sorry, using the sandbox for testing stuff.
[git.ikiwiki.info.git] / doc / tips / redirections_for_usedirs.mdwn
1 Want to turn on the `usedirs` setting on an existing wiki without breaking
2 all the links into it? Here's a way to do it for Apache, using the
3 RewriteEngine. This example is for a wiki at the top of a web site, but can
4 be adapted to other situations.
6         # pages
7         RewriteCond $1 !^/~          # these pages
8         RewriteCond $1 !^/doc/       # are not part of
9         RewriteCond $1 !^/ajaxterm   # the wiki, so
10         RewriteCond $1 !^/cgi-bin/   # don't rewrite them
11         RewriteCond $1 !.*/index$
12         RewriteRule (.+).html$ $1/ [R]
13         
14         # rss feeds
15         RewriteCond $1 !^/~
16         RewriteCond $1 !.*/index$
17         RewriteRule (.+).rss$ $1/index.rss
18         
19         # atom feeds
20         RewriteCond $1 !^/~
21         RewriteCond $1 !.*/index$
22         RewriteRule (.+).atom$ $1/index.atom