Fix Wordpress with all pages returning 404 not found

April 10, 2020

Problem: I encounter a weird problem in Wordpress, where the homepage is able to load properly, but all the pages are failing to load. An error page display:

Not Found

The requested URL was not found on this server.

However, since the files were migrated from the other server, all the pages should exist already. And I was guessing the problem may be due to the .htaccess file, but still no clue after hours of troubleshooting.

Solution: Turns our for my case, the .htaccess file is correctly configure. Instead, edit the file:

    sudo vi /etc/httpd/conf/httpd.conf

and find the section with

    <Directory "/var/www/html">

Then change the config to from AllowOverride None to

    AllowOverride All

Finally restart the server:

    sudo systemctl restart httpd

All the pages are able to render properly now.

Profile picture

Experience in software development, application architecture, and deploying cloud solutions for enterprise customers. Strong hands-on skills with a Master's degree in Computer Science and business acumen with a master of business administration (MBA) in Finance. Certified in Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure, Kubernetes (CKA, CKAD, CKS, KCNA) and Scrum (PSM, PSPO) with experience in building banking products from scratch. Connect on Linkedin

© 2022, @victorleungtw