- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to change the url of admin and how to safeguard it.
Please help me asap, any help will be appreciated.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@akashay _kc In the same file you can find 'session'.
Just replace that with the below line of code.
'session' => [ 'save' => 'files' ],
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
php bin/magento setup:config:set --backend-frontname="admin_path"
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.
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.
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@akashay _kc In the same file you can find 'session'.
Just replace that with the below line of code.
'session' => [ 'save' => 'files' ],
Thanks