Fixing 404 error in wordpress on VPS running nginx

124 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

Avatar

About the Author: Toc Xoan

Leave a Reply

Your email address will not be published. Required fields are marked *