aboutsummaryrefslogtreecommitdiff
path: root/doc
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
parent30a1bf9e95b5e594e8e97b689b09b7d58385682e (diff)
downloadikiwiki-d0764e86de15b0121d60b2fe5ffbcf9eeb4d7aff.tar
ikiwiki-d0764e86de15b0121d60b2fe5ffbcf9eeb4d7aff.tar.gz
turn this into a tip
Diffstat (limited to 'doc')
-rw-r--r--doc/tips.mdwn7
-rw-r--r--doc/tips/usedirs_redirections.mdwn22
-rw-r--r--doc/todo/Document_redirections_for_use_with_usedirs.mdwn29
3 files changed, 29 insertions, 29 deletions
diff --git a/doc/tips.mdwn b/doc/tips.mdwn
index 77eeffb49..c5faa45b3 100644
--- a/doc/tips.mdwn
+++ b/doc/tips.mdwn
@@ -1,5 +1,7 @@
This page is a place to document tips and techniques for using ikiwiki.
+[[toc ]]
+
## wikiannounce
One thing I use ikiwiki for is the web pages for software projects I
@@ -33,3 +35,8 @@ access. --[[JoshTriplett]]
[[This_article|issue_tracking]] has some thoughts and tips on using ikiwiki
as a BTS, as is done on this very wiki to track [[bugs]] and [[todo]] items
for ikiwiki.
+
+## redirections for usedirs
+
+Want to turn on the `usedirs` setting on an existing wiki without breaking
+all the links into it? Here's [[how|usedirs_redirections]].
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
diff --git a/doc/todo/Document_redirections_for_use_with_usedirs.mdwn b/doc/todo/Document_redirections_for_use_with_usedirs.mdwn
deleted file mode 100644
index 2ed4c684a..000000000
--- a/doc/todo/Document_redirections_for_use_with_usedirs.mdwn
+++ /dev/null
@@ -1,29 +0,0 @@
-Now that ikiwiki supports using page/index.html rather than page.html, how about some mechanism to automatically generate a .htaccess file with "Redirect permanent" lines for each such page?
-
-> I was thinking of using an apache RewriteRule for this, haven't written
-> one yet though. --[[Joey]]
-
-> Here's a RewriteRule that I'm using for <http://kitenet.net/>, which
-> has an wiki at the top level that's using index.htmls, and some
-> other stuff that shouldn't be rewritten.
-
- RewriteCond $1 !^/~
- RewriteCond $1 !^/doc/
- RewriteCond $1 !^/ajaxterm
- RewriteCond $1 !^/cgi-bin/
- RewriteCond $1 !.*/index$
- RewriteRule (.+).html $1/ [R]
-
- RewriteCond $1 !^/~
- RewriteCond $1 !.*/index$
- RewriteRule (.+).rss $1/index.rss
-
- RewriteCond $1 !^/~
- RewriteCond $1 !.*/index$
- RewriteRule (.+).atom $1/index.atom
-
->> Nice solution. I think this would work for a newly-converted wiki as well,
->> using a condition to limit rewrites to that wiki's directory, and the
->> rewrite rule you propose. Thus, autogenerating seems unnecessary; we
->> should just have a documented, known-working RewriteCond and RewriteRule
->> for wikis that want to turn on the `usedirs` option. --[[JoshTriplett]]