WordPress 3.0 & nginx - permalink, 404 problem WordPress 3.0 & nginx - permalink, 404 problem wordpress wordpress

WordPress 3.0 & nginx - permalink, 404 problem


On your location / block,

add this and remove any non-specific rewrite rules:

try_files $uri $uri/ /index.php;


If wordpress is on another directory besides the root, instead of having

if (!-e $request_filename) {    rewrite ^/wordpress/(.+)$ /wordpress/index.php?q=$1 last;}

You can have:

location /wordpress {    try_files $uri $uri/ /wordpress/index.php?$args;}

This page has exactly the same concept. I should have read and tried it first: nginx rewrite rule under a subdirectory


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... :)