bemara57
asked on
Redirect to SSL using IIS7 UrlRewrite
I am using IIS7's new UrlRewrite engine (http://learn.iis.net/page.aspx/460/using-url-rewrite-module/). I want to redirect certain pages to an SSL page, and keep other pages off SSL for unneccessary encryption processing.
So far I have the redirect to SSL rule started, but it is not working. I am trying to keep a list of secure pages in the rewritemaps for easy maintenance and adding more secure pages in the future. Does anyone see why this is not working?
So far I have the redirect to SSL rule started, but it is not working. I am trying to keep a list of secure pages in the rewritemaps for easy maintenance and adding more secure pages in the future. Does anyone see why this is not working?
<rules>
<rule name="RequiresSSL-Redirect" stopProcessing="true">
<match url="(.+)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{RequiresSSL:{R:1}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{C:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="RequiresSSL">
<add key="path/to/secure/page.aspx" value="path/to/secure/page.aspx" />
<add key="nextpath/to/secure/page.aspx" value="nextpath/to/secure/page.aspx" />
</rewriteMap>
</rewriteMaps>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> So far I have the redirect to SSL rule started, but it is not working.
what is happening that is different to what you expect? Does it throw an error or does it not switch to ssl when you think it should?
Cheers.
what is happening that is different to what you expect? Does it throw an error or does it not switch to ssl when you think it should?
Cheers.
It has rules for a number of common rewrite situations, including http to https.