I've written a simple web application using asp.net mvc3 and I have a login page which control access to the site. Every request which is not authenticated will redirect to this page.
I want to use ssl to make the site secure (using https). I don't want to use https for all of my sites because it make it heavy for browsers.
The problem is when I add following tags to web.config, VS2010 ultimate does not recognize it and does not work.
I have deployed the project to IIS 7.5 too but it does not work either. what should I do?
<system.webServer>
<rewrite>
<rule name="Redirect to HTTP">
<match url="secureDir/(.*)" negate="true" />
<conditions>
<add input="{HTTPS}" pattern="^ON$" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" />
</rule>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="secureDir/(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
</rewrite>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>