diff options
author | http://certifi.ca/lunix <http://certifi.ca/lunix@web> | 2009-09-27 18:06:19 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2009-09-27 18:06:19 -0400 |
commit | ba4071bde21a199e77f15b54d8785debc69613e6 (patch) | |
tree | e63dca490e971ff0432e0cb9185801049e32af97 | |
parent | bfad3f23d07ab58502a507fcdaf9254b08f4f23d (diff) |
updated with nginx solution
-rw-r--r-- | doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn | 34 |
1 files changed, 33 insertions, 1 deletions
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 + } + } + |