]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/tips/switching_to_usedirs/discussion.mdwn
apache config sniplet for usedirs migration
[git.ikiwiki.info.git] / doc / tips / switching_to_usedirs / discussion.mdwn
index 3a9487c4273700da19ad225b00af383b14fe72ae..fe937c5dddc44b25a7311572a28473ae0fd70e1b 100644 (file)
@@ -18,4 +18,21 @@ This may serve only to highlight my naivete, but what are the advantages of the
 
 It seems to me that the only advantage is slightly tidier URLs, but with the disadvantage that source files change dir level and relative links need to change too.
 
--- [[KarlMW]]
\ No newline at end of file
+-- [[KarlMW]]
+
+The cleaner urls seem worth it to me. The `urlto()` function makes it easy
+for ikiwiki code to deal with the path changes. --[[Joey]]
+
+--------
+
+when migrating to usedirs, the following apache config sniplet might be useful (use inside the Directory section that manages your wiki):
+
+    RewriteEngine on
+    RewriteCond %{REQUEST_FILENAME} !-f
+    RewriteRule ^(.+)\.html$ /my_base_path/$1/ [R]
+
+that sniplet causes redirects from any non-existing .html file to the respective usedirs directory. (when serving from the host root url, drop the my_base_path part, otherwise adapt it to your needs).
+
+i recommend using this or a similar mechanism to keep your old urls reachable.
+
+--[[chrysn]]