Magento admin 404 error is a common error that often occurs in all online stores. There are many reasons leading to this problem. Let’s follow this post, we will show you some reasons why it happens, as well as solutions on how to resolve
Cause of admin 404 error in Magento 2
When working on Magento 2, you would know that you have to perform lots of tasks from the admin panel. After you have set up the new website based on Magento 2, there are circumstances you might encounter the problems of admin 404 error, or after any security or any third-party module can lead to your admin login page inaccessible with 404 error page. Here are some common reasons why you get a Magento admin 404 error and guidance on how to solve them. Please, follow the steps to learn how to deal with the issue of each case.
- After installing/upgrading
- URL keys are changed
- Fresh Install On Ubuntu/Centos/Debian
- Page 403 Forbidden errors
- Messy page, no style
How to solve Magento admin 404 error
The important thing you need to know is that although 404 errors do not impact your Magento 2 website’s rankings in Google Search Results, they do consume the already limited crawl budget, which finally brings you unwanted losses. Therefore, it’s crucial to fix 404 pages not found errors in your online store as soon as you identify them. Since there are multiple possible reasons for this, there are some possible solutions as well. You can do it one by one until the problem is handled.
1. Recheck your admin URL in
- Firstly, you move to app/etc/ and open the env.php file.
- In this file, search for the admin URL code, which should be like below:
return array ( 'backend' => array ( 'frontName' => 'admin_q76xvk', ),
- If the URL code is different, ensure to type the above admin URL code correctly.
2. Flush Magento cache
Also, you can flush Magento cache by following the below command line:
php bin/magento cache:clean rm -rf var/cache/* rm -rf var/generation/*
3. Serve files from the /pub directory
This method is specifically for users on Magento version 2.4.2 and above. The cause for this is that you may run into a 404 not found error after a fresh install of Magento 2.4.2 is due to a change starting from Magento 2.4.2, which asks you to set up the webroot to /pub/ for better security.
To solve this problem, we suggest you follow the official guide by Magento. The whole process includes some steps such as: editing your server configuration, updating the base URL, updating the
env.php file, and switching mode.
.htaccess file in the root folder
Add/replace the default
.htaccess file in the root folder with the official
.htaccess file from the Magento codebase.
5. Delete var/cache folder
At last, if the above 4 methods don’t fix all 404 errors in your Magento 2 store, then it’s high time to delete the var/cache folder.
Once you’ve deleted the folder, move to database SELECT * FROM core_config_data WHERE path = ‘web/seo/use_rewrites’ and change it to 0.
After that, enter the following URL in your browser:
The bottom line
These solutions will definitely help you to fix the 404 pages not found an error in Magento 2. We hope that you found our tutorial useful. Besides, if you still find it difficult to solve these problems or any further questions regarding Magento 2, then you can get in touch with Magento experts for any free support. Magesolution is one of the leading Magento 2 extensions & theme providers and Magento web development services in the world. With experienced Magento developers, we commit to offering high-quality products and services to help customers achieve their business success.
- There has been an error processing your request: How to fix this issue in Magento 2
- pdo_mysql extension is not installed: How to fix this issue in Magento 2