2

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?

1
  • How did you change the admin URL, i.e. from admin panel or from the database or using app/etc/env.php file? Commented Oct 16, 2018 at 5:12

4 Answers 4

0

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.

0

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

-1

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

-2

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)

enter image description here

After changing the URL don't forget to flush the Magento cache.

1
  • 1
    He can't access the admin (backend), how is he supposed to do this????
    – Black
    Commented Jul 16, 2020 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.