I change my admin URL to a custom URL and I cannot access my store admin anymore.
How can I revert the change that I made?
Try this:
Go to your database and find the table core_config_data
Find the path column web/unsecure/base_url
and web/secure/base_url
Then edit the value column of those rows. Remember to use /
at the ending of the URLs or it won't work.
Adding to the other answers, if you do not want to modify the DB, you can use the CLI.
If you have changed the admin path, from the CLI run: bin/magento config:set admin/url/use_custom_path 0
This will make the admin path the one that you have in app/etc/env.php (it should be in the beginning of the file):
'backend' => ['frontName' => 'admin']
(in this case, admin) be the admin path for your store.
If you want to have a custom admin path, you can leave admin/url/use_custom_path
to have a value of 1, and you can run bin/magento config:set admin/url/custom_path adminpaththatyouwant
, and in this case, you can access the admin panel at /adminpaththatyouwant.
If you have changed the admin URL, run: bin/magento config:set admin/url/use_custom 0
Don't forget to flush the cache after running these commands:
bin/magento cache:flush
You need to run below query in database:
UPDATE core_config_data SET value = 0 WHERE path = 'admin/url/use_custom';
UPDATE core_config_data SET value = 'http://127.0.0.1/m2/admin/' WHERE path = 'admin/url/custom';
UPDATE core_config_data SET value = 'http://127.0.0.1/m2/' WHERE path = 'web/secure/base_url';
UPDATE core_config_data SET value = 'http://127.0.0.1/m2/' WHERE path = 'web/unsecure/base_url';
Remove var
folder
Note: change you admin and front URL in query
Try this:
In admin panel go to Stores > Configuration
In Configuration Go to Advanced > Admin > Admin Base URL
. In this section you can change your admin URL. (Refer Below Screenshot)
After changing the URL don't forget to flush the Magento cache.
admin panel
or from thedatabase
or usingapp/etc/env.php
file?