Cookies setting

Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy

Cookie Policy
Essential cookies

These cookies are strictly necessary for the site to work and may not be disabled.

Information
Always enabled
Advertising cookies

Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.

Information
Analytics cookies

Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.

Information
mageplaza.com

How to Fix 404 Error Page Not Found in Magento 2 Admin Pages

Vinh Jacker | 04-08-2016

How to Fix 404 Error Page Not Found in Magento 2 Admin Pages

Magento 2 is one of the most powerful eCommerce platforms, but like any software, it can encounter errors. One of the most common issues is the “Magento 2 Admin 404 Not Found” error. This issue can be frustrating, especially when you need to access your admin panel urgently. This guide will walk you through the common causes of the error and provide practical solutions to resolve it. Let’s get started and solve it!

4 problems why Magento 2 404 Error Page Not Found in Admin and How to Fix

Here are 4 reasons why you get a 404 Error Page Not Found in the backend and guidance on how to solve them. Please, follow the steps to learn how to deal with the issue of each case.

Learn how to create a custom 404 page in Magento 2 here.

Problem 1: After installing/upgrading

Description: You may get the error in cases of:

  • After installing a new extension
  • After upgrading extensions
  • After applying patches of Magento core or extensions.

Solution:

Flush Magento Cache with command line:

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

Read How to flush Magento 2 cache for more details.

  • Flush cache in Admin: Admin > Systems > Cache Management
  • Log out then login again

Case: 404 Error Page not found error on extension admin route update Installing SUPEE - 6788

Try to contact the extension provider for more details.

Problem 2: Fresh Install On Ubuntu/Centos/Debian

Description: After installation on Ubuntu/Centos/Debian, this error may be shown like this:

magento 2 404 error after install

Why?

It’s because your server does not enable rewrite mode.

Solution

  1. Enable Rewrite mode
sudo a2enmod rewrite
  1. Configure apache

For Ubuntu / Debian edit the file /etc/apache2/apache2.conf. To edit this file, you can run command

sudo vi /etc/apache2/apache2.conf 

Modify from:

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

to

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

Then restart apache

sudo service apache2 restart

or

sudo /etc/init.d/apache2 restart
  1. If the admin still displays a 404 error, take the following steps:

a, Place the .htaccess file from the root of Magento 2

b, Execute the following commands:

  • php bin/magento setup:upgrade
  • php bin/magento setup:static-content:deploy
  • rm -rf var/cache/*
  • rm -rf var/generation/*

Problem 3: Page 403 Forbidden errors

If you are experiencing with 403 Forbidden errors while accessing the Magento store, you should update Apache configuration to allow visitors access to your site.

Solution

  • Open apache2.conf file
  • For Ubuntu, the file /etc/apache2/apache2.conf. To edit this file run command
sudo vi /etc/apache2/apache2.conf 

Update like this:

<Directory /var/www/>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	Allow from all
</Directory>

Problem 4: Messy page, no style

Description: As shown in the image below, a messy frontend may occur, leading to the 404 error in the backend.

Messy page, no style

Why?

There are 2 cases:

  • Your server does not enable rewrite mode, try this solution
  • Deploy static content: follow the solution below.

Solution

It is because the static content is not generated in the pub/ folder. Let’s run this command to deploy it. Please try to run the following command:

php bin/magento setup:static-content:deploy

Problem 5: A change starting from Magento 2.4.2

Description

This fix is for people using Magento version 2.4.2 and newer. If you see a 404 error after installing Magento 2.4.2, it’s because of a change in Magento 2.4.2.

Solution

You need to set the webroot to /pub/ to enhance security. To solve this, follow Magento’s official guide. It includes steps like changing server settings, updating the base URL, changing the env.php file, and switching modes.

The bottom line

The “Magento 2 Admin 404 Not Found” error is a common issue with various potential causes. By following the troubleshooting steps outlined above, you can resolve this error and regain access to your admin panel. If the issue persists, consider seeking professional assistance to avoid further complications.

Regular maintenance and careful management of your Magento store can help prevent such errors in the future. Remember, a healthy Magento store is crucial for delivering a seamless shopping experience to your customers.

If you’re looking for reliable support, Mageplaza offers a comprehensive agento 2 maintenance serviceM to help keep your store running smoothly. Their team of experts can handle error resolutions, updates, and ongoing optimizations, ensuring your store performs at its best.

What about Magento 2 backend not working error?

FAQ

1. How can I redirect a 404 error page in Magento 2?

To redirect a 404 error page, navigate to Marketing > Advanced SEO Suite > Redirects, and insert a redirect for any 404 error page. You have the option to redirect visitors to your homepage or, if manually redirecting, to a pertinent category page.

2. How do I find my Magento admin URL if it’s custom?

Check the env.php file in the app/etc directory. Look for the backend array, which contains the frontName value that specifies your custom admin URL.

3. Can server configuration affect the 404 error in Magento 2 Admin?

Yes, improper server settings, such as missing mod_rewrite (on Apache) or incorrect .htaccess file configurations can lead to this error.

4. What should I do if clearing the cache doesn’t resolve the issue?

If clearing the cache doesn’t help, verify the base URL settings, check file permissions, and ensure the admin URL in the env.php file is correct.

x
    Jacker

    With over a decade of experience crafting innovative tech solutions for ecommerce businesses built on Magento, Jacker is the mastermind behind our secure and well-functioned extensions. With his expertise in building user-friendly interfaces and robust back-end systems, Mageplaza was able to deliver exceptional Magento solutions and services for over 122K+ customers around the world.



    Related Post

    Website Support
    & Maintenance Services

    Make sure your store is not only in good shape but also thriving with a professional team yet at an affordable price.

    Get Started
    mageplaza services