cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the url of admin and how to safeguard it

SOLVED

How to change the url of admin and how to safeguard it

How to change the url of admin and how to safeguard it.

 

Please help me asap, any help will be appreciated.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: How to change the url of admin and how to safeguard it

@akashay _kc You can change the admin url from app/etc/env.php

 

There you find the below line of code.

 

'backend' => [
        'frontName' => 'admin'
    ],

Just replace admin with the text you want.

Make sure to choose the text which is not so common like admin because it will be easily hacked.

 

Thanks

 

View solution in original post

Re: How to change the url of admin and how to safeguard it

@akashay _kc In the same file you can find 'session'.

 

Just replace that with the below line of code.

 

 'session' => [
        'save' => 'files'
    ],

Thanks

View solution in original post

4 REPLIES 4

Re: How to change the url of admin and how to safeguard it

@akashay _kc You can change the admin url from app/etc/env.php

 

There you find the below line of code.

 

'backend' => [
        'frontName' => 'admin'
    ],

Just replace admin with the text you want.

Make sure to choose the text which is not so common like admin because it will be easily hacked.

 

Thanks

 

Re: How to change the url of admin and how to safeguard it

Hello @akashay _kc 

 

There are 3 methods to set custom Magento 2 admin URL and secure the admin panel:

 

via SSH

Run this command:

Manually

  • Navigate to app/etc/env.php
  • Change ‘frontName’ => ‘admin’,
  • Clear cache

via Admin panel

  • Log in the Admin panel
  • Navigate to Stores > Configuration
  • Click on Admin under Advanced section.
  • Under Advanced, click Admin and expand the Admin Base URL section.
  • Set Use Custom Admin URL to “Yes”.
  • Enter the custom admin URL
  • Also, you can enable the “Use Custom Admin Path” field and just set the custom admin path instead of the entire URL. This is an alternate method.
  • You will be logged out and redirected to the new Admin URL.

Change-backend-URL-from-admin-panel

After using one of the methods to change the admin URL in Magento 2, you can type the new admin URL and log in as usual.

 

I hope it helps you.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: How to change the url of admin and how to safeguard it

Thanks for prompt help @rahul Gupta , Its working! 

However, can you please suggest me where to find the configuration to save session in files.

Re: How to change the url of admin and how to safeguard it

@akashay _kc In the same file you can find 'session'.

 

Just replace that with the below line of code.

 

 'session' => [
        'save' => 'files'
    ],

Thanks