How to change Admin's URL? Change site.com/admin to site.com/sometext

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
How to change Admin's URL?
So that no one knows how to enter to your admin's area...

Change site.com/admin to site.com/sometext
8 years ago
Does it really matter the admin url is? Because you need to add the /admin to your robots.txt to stop it being indexed by crawlers. So if someone wants to know what your admin url is, they can just find it out by viewing your robots.txt.
8 years ago
But anyway if you still insist on changing it, you just need to change the slug in AdminAreaRegistration.cs
8 years ago
How to do that?
8 years ago
Although it is possible to restrict people from accessing the admin page by allowing specific IP addresses, it may not always be convenient. For instance, you may want to access the admin page, but you are not connected somewhere where you have an allowed IP address.

Changing the URL to something unknown may prevent intruders from gaining unauthorized access to your site, and would also prevent Google from indexing it, since it is only known by you.

I wrote a blog post about this here:

https://xzuttz.wordpress.com/2015/11/18/nopcommerce-custom-admin-url/

#1 Locate AdminAreaRegistration.cs located in Nop.Web\Administration

#2 Change the RegisterArea method to:

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Admin_default",
"Adminx5456sdae1d/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", area = "Admin", id = "" },
new[] { "Nop.Admin.Controllers" }
);

Where “Adminx5456sdae1d” is the new URL to the administration page (you can change it to whatever you like)

The following steps are very important:

#3 Delete the contents of your  bin folder in Nop.Web\bin – this is to ensure that there is nothing cached

#4 Rebuild your project and verify that the new admin URL works
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.