Wordpress and nginx 404 errors all but home page

August 29, 2014 48.3k views

Only home page on my wordpress site is working but all the links are 404 Not Found
nginx/1.4.6 (Ubuntu)
Any suggestion what should I do ?

1 comment
5 Answers

Guys.. work fine but you have to use: try_files, not tryfiles.. like code below

location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ /index.php?q=$uri&$args; 
        #try_files $uri $uri/ =404;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules

It’s seems like you did not configured your server configuration file in /etc/nginx/sites-available folder properly.
Check that you have put
tryfiles $uri $uri/ /index.php?q=$uri&$args;
instead of
files $uri $uri/ =404;
It will fixed your 404 error hopefully.
Thank You
M A Kashem
Xponent Info System (PVT.) LTD.

This worked for me, replaced the mention portion with

try_files $uri $uri/ /index.php?q=$uri&$args;

Don’t forget after you will need to reload ngix

sudo service ngix reload

If you having any problem with 404 errors. please visit.
Acer Tech Support

Have another answer? Share your knowledge.