Question

404 page not showing when the first path of the domain is correct

Posted January 8, 2020 549 views
NginxWordPress

Anyone can help me? Why is that the 404 will show only on the main domain.

www.example.com/golf/ <— Correct Path
www.example.com/golf/asda1231 <— Wrong Path 404 doesn’t show
www.example.com/1232131asdada <— Wrong Path 404 show

I’m using Nginx, ubuntu, and Wordpress.

I have custom permalinks. /blog/%postname%/

I hope i explain it correctly.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

I think that in order for the permalinks to work, you should have something like this in your Nginx server block:

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

What is the exact error that you are getting? Do you get a standard Nginx 404?

I could also suggest checking your Nginx error log:

tail -100 /var/log/nginx/error.log

Regards,
Bobby

Submit an Answer