Personally I have an ASP.NET MVC application with FormsAutentication
and I'm having a hard time leaving a controller as the home page. I already released it in web.config
, but it still does not work. The controller is called a website, see the code:
<location path="Site">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
If I type the full address as teste.com.br/Site
it works, but if I type only teste.com.br
I'm always directed to login page.
<authentication mode="Forms">
<forms loginUrl="~/Permissao/Login" protection="All" slidingExpiration="false" timeout="60" cookieless="UseCookies"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
In my routeConfig.cs
it looks like this:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Site", action = "Index", id = UrlParameter.Optional }
);
But it is always directed to login page instead of Site, if I by the controller Site
as Start page in the project property works, but not in the hosting server, only works if setting in the project property, it seems to ignore the rest of the configuration of web.config
, route and etc ... Can anyone lend a hand?