summaryrefslogtreecommitdiff
path: root/doc/tips
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-04-11 01:17:05 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-04-11 01:17:05 +0000
commitd0764e86de15b0121d60b2fe5ffbcf9eeb4d7aff (patch)
tree9008c5855bdaf9a3f9956606cb00c14d5fe14f6a /doc/tips
parent30a1bf9e95b5e594e8e97b689b09b7d58385682e (diff)
turn this into a tip
Diffstat (limited to 'doc/tips')
-rw-r--r--doc/tips/usedirs_redirections.mdwn22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/tips/usedirs_redirections.mdwn b/doc/tips/usedirs_redirections.mdwn
new file mode 100644
index 000000000..ef356a082
--- /dev/null
+++ b/doc/tips/usedirs_redirections.mdwn
@@ -0,0 +1,22 @@
+Want to turn on the `usedirs` setting on an existing wiki without breaking
+all the links into it? Here's a way to do it for Apache, using the
+RewriteEngine. This example is for a wiki at the top of a web site, but can
+be adapted to other situations.
+
+ # pages
+ 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
+ RewriteCond $1 !.*/index$
+ RewriteRule (.+).html $1/ [R]
+
+ # rss feeds
+ RewriteCond $1 !^/~
+ RewriteCond $1 !.*/index$
+ RewriteRule (.+).rss $1/index.rss
+
+ # atom feeds
+ RewriteCond $1 !^/~
+ RewriteCond $1 !.*/index$
+ RewriteRule (.+).atom $1/index.atom