Solve 404 Error Page Not Found in Admin in Magento 2

How to Solve 404 Error Page Not Found in Admin in Magento 2?

Today, we’re going to teach you guys how to solve 404 error page not found in admin in Magento 2.

404 page not found errors are common and occur in all online stores.

And the reason why they occur in the first place is mostly when the URL keys are changed.

Now, the first thing you need to know is that although 404 errors do not impact your store’s rankings in Google Search Results, but they do consume the already limited crawl budget, which ultimately brings you unwanted losses.

Therefore, it’s important to learn how to solve 404 page not found errors in your Magento 2 store as soon as you identify them.

In this tutorial, we will show you exactly how to solve 404 error page not found in admin in Magento 2.

Steps to Solve 404 Page Not Found Error in Admin in Magento 2

There are multiple reasons that cause 404 errors, which is why we’re going to show you guys every possible solution to solve 404 page not found errors in admin in Magento 2.

You can apply these solutions one by one until all 404 errors in your Magento 2 store are resolved.

Solution #1 – Flush Magento Cache

The first and most basic solution you can apply to solve 404 errors is to flush the Magento cache using the command line as shown below.

php bin/magento cache:clean
rm -rf var/cache/*
rm -rf var/generation/*

Solution #2 – Enable Rewrite Mode

After flushing the Magento cache, if the 404 errors are not resolved, try enabling the rewrite mode using the following command:

sudo a2enmod rewrite

Once you’ve executed the above command, configure the apache.

For Ubuntu users, you will need to edit the file – /etc/apache2/apache2.conf – by executing the following command:

sudo vi /etc/apache2/apache2.conf

Next, you need to modify the following from:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

Into:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Lastly, restart the apache using the following command:

sudo service apache2 restart

or

sudo /etc/init.d/apache2 restart

or

sudo systemctl restart apache2

Solution #3 – Upload .htaccess file to Root Folder

The next solution on the list is to simply upload the default .htaccess file to the root folder of your Magento installation.

You can download the default .htaccess file from Github.

Solution #4 – Check Admin URL in env.php file

First of all, navigate to app/etc/ and open the env.php file.

In this file, look for the admin URL code, which should be like below:

return array (
'backend' =>
array (
'frontName' => 'admin_q76xvk',
),

If the URL code is different, make sure to type the above admin URL code correctly.

Solution #5 – Delete var/cache folder

Lastly, if the above 4 solutions don’t solve all 404 errors in your store, then it’s time to delete the var/cache folder.

Once you’ve deleted the folder, go to database SELECT * FROM core_config_data WHERE path = ‘web/seo/use_rewrites’ and change it to 0.

Lastly, enter the following URL in your browser:

magento_base_url/index.php/your_admin_url

Hope this helps!

Conclusion

There you have it!

These 5 solutions will definitely help you to solve 404 page not found error in admin in Magento 2.

And if you need our professional assistance with your Magento development services project, feel free to reach out to us anytime.

Magento Support Services

Tags