]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Added a comment: Alternative
authorhttp://tychoish.livejournal.com/ <http://tychoish.livejournal.com/@web>
Sat, 4 Jun 2011 12:57:15 +0000 (12:57 +0000)
committeradmin <admin@branchable.com>
Sat, 4 Jun 2011 12:57:15 +0000 (12:57 +0000)
doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment [new file with mode: 0644]

diff --git a/doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment b/doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment
new file mode 100644 (file)
index 0000000..8ad6dad
--- /dev/null
@@ -0,0 +1,23 @@
+[[!comment format=mdwn
+ username="http://tychoish.livejournal.com/"
+ ip="74.108.56.136"
+ subject="Alternative"
+ date="2011-06-04T12:57:14Z"
+ content="""
+I just have the following in my nginx config, which isn't as friendly, I think, as a 404 plugin, but it does the job: 
+
+        location / {
+            index  index.html index.htm;
+            if (!-d $request_filename) {
+               rewrite ^/(.*)/$ /ikiwiki.cgi?page=$1&do=create last;
+               rewrite ^(.*)/$ /$1.html last;
+               rewrite ^(.*)/$ /$1.htm last;
+            }
+            if (!-e $request_filename) {
+               rewrite ^/(.*)$ /ikiwiki.cgi?page=$1&do=create last;
+               rewrite ^(.*)$ $1.html last;
+               rewrite ^(.*)$ $1.htm last;
+            }
+        }
+
+"""]]