views:

443

answers:

3

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?

A: 

Have you tried the nginx Compatibility plugin?

Plus ElasticDog seems to provide a fairly concise article on getting WP working with nginx - which includes getting pretty permalinks to work.

Here's another article that seems to deal specifically with nginx rewrite rules for WordPress.

TheDeadMedic
Yes, tired the plugin - doesn't work. I also have followed ElasticDog's tutorial, I'm using much of his config now.I've also followed http://wiki.dreamhost.com/Nginx and understand most of it (I think!) but again, same problem.Whenever I change the permalinks to anything other than default and try to access a post, article or page I get the "No input file specified." error.I assume that WordPress (and the rewrites) are failing to tell WordPress what to do, but I'm getting nowhere... :(
Taffy Lewis
A: 

After much pain:

# if filename doesn't exist, take the request and pass to wordpress as a paramater
         if (!-e $request_filename) {
                rewrite ^/wordpress/(.+)$ /wordpress/index.php?q=$1 last;
         }

If the requested file does not exist, pass it to index.php. It's a bit slow and I think I might try and not use a query, but it does work... :)

Taffy Lewis
Glad to hear you made a breakthrough! Sorry @Taffy, I've no experience with nginx, but I'll always do my best to help ;)
TheDeadMedic
A: 

you will find all the solution about nginx http://wordpressapi.com/category/nginx/

wordpressapi