Changing Admin URL in Magento 2 is easy

Changing Admin URL in Magento 2 is as simple as changing URL in Magento 1 so you don’t need to worry about it -:

Step 1 : Go to your Magento installation directory and open /app/etc/env.php file

return array (
  ‘backend’ =>
  array (
    ‘frontName’ => ‘siteadmin’, //change the frontName here to change the Admin URL
  )

Step 2: Clear the cache using the following command or by removing all files from var/cache

rm -rf var/cache

That’s it, now you have the new Magento admin URL. As you can see changing Admin URL in Magento 2 can’t be easier 🙂

Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Scommerce

3 Comments

  1. this is not working .

    Giving the following error :

    Whoops, our bad…
    The page you requested was not found, and we have a fine guess why.
    If you typed the URL directly, please make sure the spelling is correct.
    If you clicked on a link to get here, the link is outdated.

    this is the settings in env.php

    array (
    ‘frontName’ => ‘nischal2’,

    • Hi Nischal,
      Can you please confirm that you are doing this for backend?

      return array (
      ‘backend’ =>
      array (
      ‘frontName’ => ‘nischal2’, //change the frontName here to change the Admin URL
      )

      And you have cleared caches? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.