Close

October 28, 2020

Magento 2 Homepage 404

Recently on a new server move, we ran into a issue that almost drove us insane. The homepage of the site would NOT come up for whatever reason. To complicate matters, we did not realize that a customer had installed an SEO plugin that redirects 404 errors to their magento search engine.

We fixed the 404 error issue first and then started to tackle the homepage issue. No matter what CMS page we had, it would not come up. The actual full link to the CMS page worked properly (ie: http://domain.com/cms).

A significant amount of research on 404 homepage issues for Magento2 revealed no viable clues. We checked the route tables to make sure there were not any empty request paths.

Finally, we took a step back and started debugging the “index.php” to print out what exactly the $SERVER variable was showing for the index page. Eureka. The requested script was “index.php” BUT it was trying to redirect to “index.html” that did not exist. Wait. Why would we need the index.html?

Created a fake index.html file and uploaded, and voila it was serving that page.

The system services team had misconfigured the apache2 setup and was ignoring the “DirectoryIndex index.php” command in our .htaccess file. Once that was fixed, Magento2 was all set.

Hopefully this helps some folks struggling with this very issue.