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

 

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

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

Hope it helps!

 

 Looking for quality nopCommerce Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , | Posted under nopCommerce | RSS 2.0

Author Spotlight

Lavish Kumar

Founder, developer and owner of StrivingProgrammers.com - By profession, he is a software programmer / web developer, web designer & DBA. He is passionate about technology and electronic gadgets. He enjoys writing tech articles and developing web applications. He is a nopCommerce MVP and author of official nopCommerce Designer's Guide.

Leave a Reply

Your email address will not be published. Required fields are marked *