Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:50:18+00:00 2026-05-27T10:50:18+00:00

I would like to have my base URL go to a specific category of

  • 0

I would like to have my base URL go to a specific category of an online store (a NopCommerce online store if that makes a difference). The URL of the category is: http://myUrl.com/c/6

After reading a few posts including Scott Gutherie’s post about MVC routing I thought I could just add the following code to my Global.ascx.cs file:

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        //register custom routes (plugins, etc)
        var routePublisher = EngineContext.Current.Resolve<IRoutePublisher>();
        routePublisher.RegisterRoutes(routes);

        routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Catalog", action = "Category", id = 6 },
                new[] { "Nop.Web.Controllers" }
        );
    }

But this didn’t seem to work. How can I accomplish what I am trying to do?

I have little experience with MVC so I apologize if any of this does not make sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:50:19+00:00Added an answer on May 27, 2026 at 10:50 am

    looks like the most interesting bits are in the nopcommerce source code. the default route is registered as

        routes.MapLocalizedRoute("HomePage",
                        "",
                        new { controller = "Home", action = "Index"},
                        new[] { "Nop.Web.Controllers" });
    

    you’ll basically want to register your default route first, before the //register custom routes comment. should end up looking like this:

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
        routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Catalog", action = "Category", id = 6 },
                new[] { "Nop.Web.Controllers" }
        );
    
        routes.MapRoute(
            "CustomHome", // Route name
            "", // URL with parameters
            new { controller = "Catalog", action = "Category", id = 6 },
            new[] { "Nop.Web.Controllers" }
        );
    
        //register custom routes (plugins, etc)
        var routePublisher = EngineContext.Current.Resolve<IRoutePublisher>();
        routePublisher.RegisterRoutes(routes);
    
    
    }
    

    the first route may not even be necessary. i’m not sure. never worked with nopcommerce.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GWT module with the X-GWT-Module-Base http://host:8080/foo/ and would like to call
I would like to specify a base URL so I don't have to always
I have a base class, and I would like to catch all exceptions of
So in my project i would like have a nice treeview that has images.
I would like to have an AppWidget that designed like this one . Image:
I would like to have a border that is 4px thick pink on the
Would like to set up a backbone route that matches a url that looks
I have a bunch of strings like memory.caching and server.base.url. Within my configuration object
I would like to have a simple a method, that can give back PHP
I would like to have a zipcode input field that listens when 5 characters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.