Magento 2 – admin page 404 after installation. In this post, let’s find out how to fix the error admin page 404 after installation in Magento 2. My environment:
- Ubuntu server
- Apache2
- PHP7
After installing magento 2 , you may get 404 error when visit admin page. In that case, you should check if mod_rewrite module is enabled and loaded using this command:
1 |
sudo a2enmod rewrite |
If you already enabled mod_rewrite, you will get this message:
1 |
Module rewrite already enabled |
Or you will get this message if you didn’t enable mod_rewrite:
1 2 3 4 5 |
Enabling module rewrite To activate the new configuration, you need to run: service apache2 restart |
Then you should run:
1 |
sudo service apache2 restart |
In case you still get 404 error after that, open your site config file:
1 |
sudo nano /etc/apache2/sites-available/000-default.conf |
Add or edit:
1 2 3 4 5 |
<Directory "/var/www/html"> AllowOverride all </Directory> |
Then restart your apache:
1 |
sudo apache2 restart |
You can get access to Magento 2 backend now.
Please contact us or leave comment if you get any problem.