In my .Net MVC web application I am controlling access to a html page (index.html) by using location tag in my web.config file.
This is working fine in my development environment.But If i publish the website to IIS it is not working and it is showing index.html instead of logon page.
Web.Config:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" protection="All" />
</authentication>
<location path="index.html">
<system.web>
<authorization>
<deny users="?" ></deny>
</authorization>
</system.web>
</location>
This is working fine in my development environment.But If i publish the website to IIS it is not working and it is showing index.html instead of logon page.
Web.Config:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" protection="All" />
</authentication>
<location path="index.html">
<system.web>
<authorization>
<deny users="?" ></deny>
</authorization>
</system.web>
</location>