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)
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)
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/*
a2dismod rewrite
(even though it was enabled!), then b) restart Apache, then c) a2enmod rewrite
and then d) restart Apache again. This solved the problem and it was the second time I encountered this on a new install of Apache. And clear cache and pray of course :)
Commented
Feb 24, 2018 at 11:35
Please try Below steps
var/cache
folderSELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites'
and make it 0
magento_base_url/index.php/your_admin_url
try and let me know if you face any issue.
index.php
from url if it sets to 1
Commented
Oct 4, 2018 at 10:32
app/etc/env.php
file
Commented
Nov 19, 2019 at 13:33
php -S localhost:8080 -t pub
, I tried your solution, but still get 404 when request localhost:8080/index.php/magento2/admin_1ibt8z
Commented
Jul 27, 2020 at 4:01
Why nobody talk about ?
bin/magento info:adminuri
This will display your adminuri. More info can be found here.
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/
web/unsecure/base_url
where the scope_id is 1
Commented
Nov 3, 2020 at 14:41
Other possible solution is to check for .htaccess
file in root directory
and add if it doesn't exists (https://github.com/magento/magento2/blob/2.4-develop/.htaccess)
I have also same issue. I updated value for "admin/url/custom" to 0 in core_config_data table and my issue resolved.
Check if the mod_rewrite
module is enabled in Apache.
To enable mod_rewite module, go to httpd.conf
file located at /etc/apache2/httpd.conf
and look for "LoadModule rewrite_module libexec/apache2/mod_rewrite.so"
, if it is commented, then uncomment it by removing # at the front.
a2dismod rewrite
2. service apache2 restart
3. a2enmod rewrite
4. service apache2 restart
- seems that disabling and enabling rewrite does the job.
Commented
Feb 24, 2018 at 11:37
I solved this issue after server migration by query db & get custom admin url
Actually my env admin path not working for admin login url
'backend' => [ 'frontName' => 'myadmin' ], http://www.magento.lan/myadmin 404 erorr
Check Admin Url:
bin/magento info:adminuri
Solution:
Step1: First Get Custom admin path
SELECT * FROM `core_config_data` where path like "%admin/url/custom_path%";
Step2: Disable Custom admin Path
Disable from db:
UPDATE `core_config_data` SET `value` = '0' WHERE `core_config_data`.`path` LIKE "%admin/url/use_custom_path%";
Disable from admin:
AdminLogin==>Store=>Configuration=>Advanced=>Admin=>Admin Base URL=>Use Custom Admin Path:=No
I hope it will be save time for someone
Hope this will help you
bin/magento setup:static-content:deploy
Run this command In your CLI
Check this for Magento 2.4.3 and Apache 2
sudo subl /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo a2enmod rewrite
systemctl restart apache2
In core_config_data change the web/unsecure/base_url to url + pub/
example
http://mylocal.com.co/magento/magento24 to http://mylocal.com.co/magento/magento24/pub/
delete cache of magento
php ./bin/magento cache:flush
Frontend.
First you have to remove content from var/cache
and var/session
folder ,then change execute this command from commandline/terminal
bin/magento setup:static-content:deploy
Below is the quick one that I had faced with v2.2.5 and fixed like below.
Go to
cd /your-project-root-folder/app/
and fire
chmod -R 755 etc/
I had a similar issue, as well. For me removing the all var folder by:
rm -rf var/
and clearing all browser cache: Cmd+Shift+Delete
or Command-Shift-Delete
for mac, did the trick.
I hope it will help someone!
go check you /app/etc/env.php
file backend[front_name => admin_kjdfk]
. and use this, like base_url/admin_kjdfk