]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/Autogenerate_a_.htaccess_file_with_redirects_from_foo.html_to_corresponding_index.html.mdwn
update
[ikiwiki.git] / doc / todo / Autogenerate_a_.htaccess_file_with_redirects_from_foo.html_to_corresponding_index.html.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?
2
3 > I was thinking of using an apache RewriteRule for this, haven't written
4 > one yet though. --[[Joey]]
5
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.
9
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]