Are you still using the default Magento 2 admin URL? Have you wondered why there’s a weird string appended to your store’s admin URL? In this blog, I will tell you why that string exists and how to prevent it from your store. Together with SmartOSC to clarify the details Learn 3 Easy Ways To Change Magento 2 Admin URL Effortlessly through the following article.
Why Should We Change Magento 2 Admin URL?
When you install Magento 2, it will automatically create an admin URL with a random string. The Magento 2 admin URL allows you to access the backend of the store and then edit and manage the administrative tasks.
Typically, the default Magento 2 admin URL is “yoursitename.com/admin”.
However, the default format is vulnerable to hackers. It is too easy for brute force attacks to crack some common URL names such as backend, admin, etc.
For your information, a brute force attack is where automated software hits your site to try out predictable username and password combinations in a very short time to try to gain access.
Therefore, in order to protect your site, you should replace the default URL with a complex and unique one. Changing the default Magento admin URL is easy to do but it can increase the security of your store and make it harder for bots or hackers to attack it.
See more articles: Magento Services Singapore
Before Changing Magento 2 Admin URL…
You must make sure that you have a Magento developer on standby before making any changes. There are a lot of cases where people change default admin URLs and then can’t access their admin panel. That’s you need a developer to fix the issue.
Also, to protect your website from going down, it is best to make these edits in a development environment. We recommend contacting your hosting provider to make sure they allow the changing of your Magento admin URL.
See more articles: Magento 2 development agency
3 Ways To Change Magento 2 Admin URL
There are 3 methods to help you change the admin URL with ease. And we will show you all three methods in the content below.
We promise it can be done within a few clicks!
Method #1: Use Admin Panel Configuration.
This the simplest and easiest method to change the admin URL.
In your Magento 2 admin panel, access Stores > Settings > Configuration.
- On the left menu, under Advanced section, click on Admin.
- Expand the Admin Base URL section.
- Set Use Custom Admin URL to “Yes”. Then, enter the Custom Admin URL in the following format: http://yourdomain.com/magento/.
- Set Custom Admin Path to “Yes”. Then, enter the Custom Admin Path. The path that you enter is appended to the Custom Admin URL after the last forward slash.
- Click the Save Config button.
Method #2: Change The Admin Path In Config.Php
- Log into your server via ssh using an SSH or FTP client . Navigate to the app/etc folder and open env.php file in a text editor.
- Look for the code that says ‘frontName’ and replace the code in the quotes to the right of ‘frontName’ and replace ‘admin’ with your new admin URL.
- Flush Cache.
return array (
‘frontName’ => ‘admin’,
Method #3: Change From The Server Command Line
- Log in your Magento hosting server via SSH. Navigate to the root directory of your store.
- Run this command: php bin/magento setup:config:set –backend-frontname=“newadminurl”
- Within the quotes for backend frontname – type in your desired new URL.
- If you would like to check or view your admin URL via command line: magento info:adminurl
See more articles: Magento development company Singapore
Here is a quick guide on how to change Magento 2 admin URL. This needs to be done for security reasons to prevent hacking/cracking issues. After referring to these methods, you can type the new admin URL and log in as usual.
SmartOSC is one of the leading Magento extension providers and web development services in the world. With experienced and certified Magento developers, we commit to bringing high-quality products and services to optimize our business effectively.
Article source: Magento Singapore