]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/todo/Autogenerate_a_.htaccess_file_with_redirects_from_foo.html_to_corresponding_index.html.mdwn
RewriteRule example
[git.ikiwiki.info.git] / doc / todo / Autogenerate_a_.htaccess_file_with_redirects_from_foo.html_to_corresponding_index.html.mdwn
index 6f4bb19a1c4520e27d556b56a2efe8649736a3e0..27dcbd9d32e43fea18e0fc37c9f48cfcc7ad604f 100644 (file)
@@ -1 +1,14 @@
-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?
\ No newline at end of file
+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 !^/cgi-bin/
+       RewriteRule (.+).html $1/ [R]
+       #RewriteRule /~family/(.+).html /~family/$1/ [R]