1
Guys I have an ASP.NET MVC app with FormsAutentication
and I’m having a hard time leaving a controller as home page. I have already released on web.config
, but it still doesn’t work. The controller is called website, see the code:
<location path="Site">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
If I enter the full address as teste.com.br/Site
works, but if you type only teste.com.br
I am 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
is 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 put the controller Site
how Start page on the project property works, but on the hosting server does not, that is, it only works if you set up in the project property, it seems that all the rest of the project’s configuration is ignored web.config
, route and etc... Someone can give a hand?
Your Controller is decorated with a
[Authorize]
?– Leonel Sanches da Silva
In the controller "Site" I put [Allowanonymous], the strange thing is that if I put the controller as project start page it works.
– Alexander Leão dos Reis