Alex Rivera | Logout

WordPress 3.0 & nginx - permalink, 404 problem

Asked 2010-07-15T12:22:48.127
9

I've installed nginx, FastCGI and PHP on my server. WordPress 3.0 installed after a bit of a monster battle, but it's installed and working well.

However, when I change the permalink settings to anything other than default, I get 404 errors on every post, article and page.

I understand that this is something to do with nginx not supporting .htaccess and WordPress getting confused with where to go when a page is requsted.

I've tried a few rewrites in the nginx conf files and even the nginx compatibility plugin; neither have worked. With one rewrite I managed to stop the 404 errors, but instead of WordPress finding the post I was after I merely got my PHP confirmation page. Bah.

Forums are littered with people with similar issues. Does anyone have a solution?

Edit
Report

1 Answer

0

this does not work if you are using location other than / like:

~ .php$, what i meant to say that pretty link will work but your graphics will be all over the place. so what you need is exactly stated below.

http://www.pearlin.info

  location ~ \.php$



   {
        try_files $uri $uri/ /index.php?$uri&$args;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

  if (!-e $request_filename){
    rewrite ^(.*)$ /index.php?url=$1 break;
  }
answered 2013-05-28T18:31:02.810

Your Answer