diff options
author | http://tychoish.livejournal.com/ <http://tychoish.livejournal.com/@web> | 2011-06-04 12:57:15 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2011-06-04 12:57:15 +0000 |
commit | 7d2d0768a3c9ee60891f697fb9c02b3db30928f3 (patch) | |
tree | 29dc4439d06489ccd54c79f038db26a604d09d19 | |
parent | 9d2258379b7c705901bc8a2697eb0c9440bcbcff (diff) | |
download | ikiwiki-7d2d0768a3c9ee60891f697fb9c02b3db30928f3.tar ikiwiki-7d2d0768a3c9ee60891f697fb9c02b3db30928f3.tar.gz |
Added a comment: Alternative
-rw-r--r-- | doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment | 23 |
1 files changed, 23 insertions, 0 deletions
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 index 000000000..8ad6dadfc --- /dev/null +++ b/doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment @@ -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; + } + } + +"""]] |