]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/todo/Document_redirections_for_use_with_usedirs.mdwn
add rewriteriles for rss and atom feeds
[git.ikiwiki.info.git] / doc / todo / Document_redirections_for_use_with_usedirs.mdwn
1 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?
3 > I was thinking of using an apache RewriteRule for this, haven't written
4 > one yet though. --[[Joey]]
6 > Here's a RewriteRule that I'm using for <http://kitenet.net/>, which
7 > has an wiki at the top level that's using index.htmls, and some
8 > other stuff that shouldn't be rewritten.
10         RewriteCond $1 !^/~
11         RewriteCond $1 !^/doc/
12         RewriteCond $1 !^/ajaxterm
13         RewriteCond $1 !^/cgi-bin/
14         RewriteCond $1 !.*/index$
15         RewriteRule (.+).html $1/ [R]
16         
17         RewriteCond $1 !^/~
18         RewriteCond $1 !.*/index$
19         RewriteRule (.+).rss $1/index.rss
20         
21         RewriteCond $1 !^/~
22         RewriteCond $1 !.*/index$
23         RewriteRule (.+).atom $1/index.atom
25 >> Nice solution.  I think this would work for a newly-converted wiki as well,
26 >> using a condition to limit rewrites to that wiki's directory, and the
27 >> rewrite rule you propose.  Thus, autogenerating seems unnecessary; we
28 >> should just have a documented, known-working RewriteCond and RewriteRule
29 >> for wikis that want to turn on the `usedirs` option.  --[[JoshTriplett]]