]> sipb.mit.edu Git - ikiwiki.git/commitdiff
updated with nginx solution
authorhttp://certifi.ca/lunix <http://certifi.ca/lunix@web>
Sun, 27 Sep 2009 22:06:19 +0000 (18:06 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 27 Sep 2009 22:06:19 +0000 (18:06 -0400)
doc/forum/missing_pages_redirected_to_search-SOLVED.mdwn

index cd544ecaf501bc7e31f819f4e4eced34b13c04e5..3af83396cd0722e2c5a7eee4cfb5521cc74e6f00 100644 (file)
@@ -1,4 +1,36 @@
 Is it possible to have any missing pages(404's) redirected to the search(omega) ?  
 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
+            }
+    }
+