How to Fix Magento 2 Homepage 404 Error

Magento 2 Homepage 404 error is commonly reported by merchants after a fresh installation of Magento or an upgrade. In this post, I am going to share a working solution for Magento 2 Homepage not found error.

The homepage is an important page of any online store. It acts as a medium for visitors to learn more about your business before they become customers. The Magento 2 homepage 404 error can affect the conversions in your online store and directly affect the revenue. The SEO impact of a 404 error on the Magento 2 homepage can not be just ignored.

In case you’re facing the Magento 2 homepage not found an error in your live site, fix it immediately.

There can be mainly two reasons your Magento 2 homepage is throwing the 404 error:

  1. Incorrect Page Setup
  2. URL Rewrite Issue

Let’s see the complete step-wise method to solve the homepage 404 error in Magento 2!

Method to Solve the Magento 2 Homepage 404 Error

Try each of the following methods to fix the Magento 2 homepage not found the issue.

Incorrect Page Setup

The probable reason for Magento 2 homepage 404 can be your store configuration pointing to a wrong CMS page.

Follow these steps to set the correct CMS page for homepage:

  • Log into Magento 2 admin panel.
  • In the left panel, click Stores > Settings > Configuration.
  • Go to the Web section, and expand Default Pages.
  • Make sure that CMS Home Page points to the correct page.
Select correct CMS page for homepage in Magento 2
  • Click Save Config.

Flush system cache in System > Cache Management and check if the homepage still shows the 404 error.

The problem will be solved if it was due to wrong CMS page selection in the configuration.

If the Magento 2 homepage 404 error still persists, then it can be because of URL Rewrite issue.

URL Rewrite Issue

The homepage (with blank request path) may be pointing to a non-existing target path.

You can fix Magento 2 Homepage 404 Error by deleting the entry with blank request_path in the url_rewrite table.

  • In the Magento database, open the url_rewrite table.
  • Run the following SQL query to find the entries with blank request path:
SELECT * FROM url_rewrite WHERE request_path='';
  • Delete the entries by using the followng SQL Query:
DELETE FROM url_rewrite WHERE request_path='';

Ta-daa! The Magento 2 homepage will start working again.

I hope you’ll find the above solution helpful to fix Magento 2 homepage 404 issue. Check the CMS page configuration, and correct the URL rewrite in the database to fix the Magento 2 homepage 404 error issue.

Thanks for reading.

Sanjay Jethva

Article by

Sanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for...