Fixing 404 error in wordpress on VPS running nginx

73 Likes Comment
Error 404 on Wordpress nginx

Apache rewrite rules and Nginx rewrite rules are different

In apache, all you need to configure permalink using mod_rewrite module in .htaccess file. But in Nginx you’ll do in nginx.conf rewrite rules.

To avoid 404 error in wordpress, configure in your website /domain conf, change the block config location / {…..} to :

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

and reload the new configuration of nginx

service nginx reload

This tip works stably on my wordpress on VPS using vultr ( CentoS7 / Nginx / php 7.4 )

This post has referral link to my recommended VPS !!!

You might like

About the Author: Toc Xoan

This guy likes taking photos, hunting cheap tours, exploring the unique culture of every cities of Vietnam. Contact: [email protected]. I've created a dogecoin wallet to receive blog funding: DE6F5FisSCy7yz5rpHY1ChMSGYnDMpFZ1Q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.