404 not found error for admin page
I installed Magento successfully, but the Admin page gives error: 404 not found. Please suggest a solution for this.
The following is the error:
404 Not Found
nginx/1.10.0 (Ubuntu)
Solutions
For Linux edit the file /etc/apache2/apache2.conf
To edit this file use sudo vi /etc/apache2/apache2.conf command
<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>
After this run command
sudo service apache2 restart
IF STILL ADMIN SHOW 404 NOT FOUND, FOLLOW THIS STEP
1) Add .htaccess at root of magento 2
https://github.com/magento/magento2/blob/2.3-develop/.htaccess
2) Now run this command
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
rm -rf var/cache/*
rm -rf var/generation/*
Please try Below steps
- Delete
var/cache
folder - Go to database
SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites'
and make it0
- Then enter url in your browser
magento_base_url/index.php/your_admin_url
try and let me know if you face any issue.
I also had this issue, it turned out one of my URLs was set to the IP address and not to the domain name so going to the {domain}/admin was returning not found.
Solution was to run
php bin/magento config:set web/secure/base_url https://domain.com/
php bin/magento config:set web/unsecure/base_url https://domain.com/
Don't forget the trailing slash, it will not work without it https://alanstorm.com/invalid-base-url-value-must-be-a-url-or-one-of/