Linked Questions

Popular Questions

MVC home route to be default always as /shopping

Asked by At

Am trying to default my route on home page and make it show on Google.

My site is www.timefor.com but I always want it to show www.timefor.com/shopping

the default controller is home/index as normal. but the website shows as "www.timefor.com" when i run it

How do I get shopping being defaulted.

I have tried changing the default route map but no luck.

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    namespaces: new[] { "MyNamespace.Controllers" }
);

HomeController

public class HomeController : Controller
{

    public ActionResult Index()
    {
        return View("Index");
    }
}

When I start the project I want the URL to be as:

www.timefor.com/shopping

Related Questions