Configure Route page MVC

1

I have a website and that upon entering the homepage it is redirected to another view .

So:

  

www.example.com redirects to www.example.com/Home/Hotsite

This is because I have a feature that when I enter the view Home/Index www.exemplo.com/xpto , will load the view Index which is the login screen, customized according to the parameter passed (xpto).

I wonder if it is possible to hide the redirected URL from view Hotsite, so when I enter www.exemplo.com , it will only display www.exemplo.com , not www.exemplo.com/Home/Hotsite .

Is it possible to do this without changing views ?

These are the routes I have:

routes.MapRoute(
            name: "Inicial",
            url: "{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
    
asked by anonymous 12.09.2016 / 22:58

1 answer

0

Resolving with areas

You can use the areas feature to right-click on the project name and select Add / Area *

With this you can create for example admin routes:

  • site.com/admin/home
  • site.com/admin/users
  • site.com/admin/test
  • MSDN Reference

        
    13.09.2016 / 01:25