How to change default admin URL in nopCommerce

Security is always a concern for any business owner and when it comes down to the online store, website security should never be neglected because hackers can take down your online store in an instance. Many online store owners follow different security methods to make sure their website is secured. There is a percentage of online users who believe that making difficult URLs that are not easy to remember is one way to keep secured sections of the website away from online hackers.

If you are one of those users, this article is for you. Store admins or developers who wish to change the default admin URL of nopCommerce administration section should follow these steps.

The default admin panel URL is: www.YourDomain.com/Admin

Go to: Nop.Admin (or Nop.Web\Administration) \ AdminAreaRegistration.cs

nopcommerce admin url


Open the "AdminAreaRegistration.cs" file and locate the following code:

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


If you look closely, you will that the word "Admin" is defined in this "RegisterArea" method. So, if you change it to something else, the change should reflect in the admin URL too.

Now, update your code like this:

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


Rebuild the solution,  run your website and try going to the administration section (by default URL), you should see this error:





Now, if we try to go to the new URL: www.YourDomain.com/AdminUser101zz09811

nopcommerce admin url


It is certainly not easy for anyone to figure out or guest the admin URL "AdminUser101zz09811".

Hope it helps!

A copy of this article is also available on Arvixe Blog.

About Author

Written By Lavish Kumar

Based out of New York, USA, Lavish Kumar is a full stack web developer by profession and founder of Striving Programmers, a trusted community for developers that offers a wealth of articles and forums to assist individuals with improving their software development skills.

Leave your comment