]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn
(no commit message)
[ikiwiki.git] / doc / forum / missing_pages_redirected_to_search-SOLVED.mdwn
1 Is it possible to have any missing pages(404's) redirected to the search(omega) ?  
2 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)  
3
4 ##DONE  
5
6 I use nginx instead of apache.   
7 Just add the following to the `server` block outside of any location block in nginx.conf  
8 You must also make sure you have setup and enabled the search plugin(omega)
9
10     error_page  404              /ikiwiki.cgi?P=$uri;
11
12
13 My full nginx.conf  
14
15     server {
16             listen  [::]:80; #IPv6 capable
17             server_name  www.lunix.com.au;
18             access_log  /var/log/nginx/www.lunix.com.au-access.log  main;
19             error_log  /var/log/nginx/www.lunix.com.au-error.log warn;
20             error_page  404              /ikiwiki.cgi?P=$uri;
21    
22     location / {
23                     root    /home/lunix/public_html/lunix;
24                     index  index.html index.htm;
25     }
26    
27     location ~ ikiwiki\.cgi$ {
28                     root    /home/lunix/public_html/lunix;
29                     include /etc/nginx/fastcgi_params.cgi;
30     
31                     fastcgi_pass   127.0.0.1:9999;
32                     fastcgi_param  SCRIPT_FILENAME  /home/lunix/public_html/lunix$fastcgi_script_name;  # same path as above
33             }
34     }
35     
36