Reputation: 76
I have installed Magento2 on my WAMP server. And when I tried to access http://127.0.0.1/magento2/admin/
it's redirecting to http://localhost/admin/admin/dashboard/
(An invalid URL)?
Upvotes: 1
Views: 6015
Reputation: 1
The redirected url is correct if it is opening properly
/admin is the default url to open the admin dashboard in Magento
Upvotes: 0
Reputation: 36
need to enter host entry for local
sudo nano /etc/apache2/sites-available/000-default.conf
Add the path to your Magento pub/ directory to the DocumentRoot directive
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2/pub
ServerName hostname.magento.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
sudo systemctl restart apache2
Upvotes: 0
Reputation: 29
Open Mysql and run below mysql query:
UPDATE `core_config_data` set value = "http://127.0.0.1/magento2/admin/" WHERE path like "%base_url"
After run Mysql query you need to run below command in ssh terminal for flush cache or you can direct delete magento root var/cache folder. After that try to open magento admin it would work.
php bin/magento cache:flush
Upvotes: 0
Reputation: 1
Check your base_url
on database core_config_data
table
And also check app/etc/env.php
frontName
value.
After that:
set module:developer
setup:upgrade
clean cache
Upvotes: 0
Reputation: 827
I hope it will works!
First you can check the file app/etc/env.php and check backend frontName should be 'admin' like below.
return [
'backend' => [
'frontName' => 'admin'
],
...........
...........
...........
];
And then run this command
php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Upvotes: 0
Reputation: 91
the file app/etc/env.php
should start like this.. check your backend frontName :)
<?php
return array (
'backend' =>
array (
'frontName' => 'admin_xu4zwa'
),
);
Upvotes: 6
Reputation: 147
I think you need to set web/unsecure/base_url and web/secure/base_url
in core_config_data
table with your url like : http://127.0.0.1/magento2/
Or you can set this setting from admin side
Stores > Configuration > General > Web:
Base Urls
Base URL : http://127.0.0.1/magento2/
Base Urls (Secure)
Base URL : https://127.0.0.1/magento2/
Upvotes: 0
Reputation: 508
After installation of Magento2 site into a new location, you need to run all magento commands, after changing url in core_config_data table and changing connection in app/etc/env.php file.
php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Upvotes: 0
Reputation: 183
I think your magento installation foldername and value in table core_config_data field "base_url" is not same.
core_config_data
WHERE (scope
LIKE '%_url%' OR path
LIKE '%_url%' OR value
LIKE '%_url%') LIMIT 50note: magentoxyzfoldername is your magento installation folder name.
Upvotes: 2
Reputation: 486
change base url from core_config_data table and check frontName in app/etc/env.php file. Hope, this will help.
Upvotes: 0
Reputation: 1
change the base_url value in table core_config_data
to http://127.0.0.1/magento2/
instead of http://localhost/magento2/
, you can find the record in the table using
SELECT * FROM core_config_data WHERE path='web/unsecure/base_url';
.
Upvotes: 0
Reputation: 1328
You need to check the following
Upvotes: 1
Reputation: 475
We can also check the admin url by using command
$ php bin/magento info:adminuri
Upvotes: 1