From: http://certifi.ca/lunix Date: Sun, 27 Sep 2009 22:06:19 +0000 (-0400) Subject: updated with nginx solution X-Git-Tag: 3.20091009~99^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba4071bde21a199e77f15b54d8785debc69613e6;p=ikiwiki.git updated with nginx solution --- diff --git a/doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn b/doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn index cd544ecaf..3af83396c 100644 --- a/doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn +++ b/doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn @@ -1,4 +1,36 @@ Is it possible to have any missing pages(404's) redirected to the search(omega) ? -So if someone comes to my site with http://example.com/foo_was_here it would result in 'foo_was_here' being passed as a search parameter to omega ? --[Mick](http://www.lunix.com.au) +So if someone comes to my site with http://example.com/foo_was_here it would result in 'foo_was_here' being passed as a search parameter to omega ? --[Mick](http://www.lunix.com.au) +##DONE + +I use nginx instead of apache. +Just add the following to the `server` block outside of any location block in nginx.conf +You must also make sure you have setup and enabled the search plugin(omega) + + error_page 404 /ikiwiki.cgi?P=$uri; + + +My full nginx.conf + + server { + listen [::]:80; #IPv6 capable + server_name www.lunix.com.au; + access_log /var/log/nginx/www.lunix.com.au-access.log main; + error_log /var/log/nginx/www.lunix.com.au-error.log warn; + error_page 404 /ikiwiki.cgi?P=$uri; + + location / { + root /home/lunix/public_html/lunix; + index index.html index.htm; + } + + location ~ ikiwiki\.cgi$ { + root /home/lunix/public_html/lunix; + include /etc/nginx/fastcgi_params.cgi; + + fastcgi_pass 127.0.0.1:9999; + fastcgi_param SCRIPT_FILENAME /home/lunix/public_html/lunix$fastcgi_script_name; # same path as above + } + } +