Windows – IIS 7 – allow http for part of site, https for rest

httphttpsiisiis-7windows

In IIS 7, is there a way to set two urls on the same site to allow http and https, and the rest to be https only?

 - http://mysite/url1 or https://mysite/url1 is accepted and stays on that protocol.
 - http://mysite/url2 or https://mysite/url2 is accepted and stays on that protocol.
 - any other item, i.e. http://mysite/whatever redirects to https://mysite/whatever
 - https://mysite/whatever is accepted.

Edited because first question wasn't clear enough.

Best Answer

The most friendly way to do this is with IIS URL Rewrite since it won't throw an error if they arrive by HTTP but it will redirect to HTTPS for them. You can set the rule to redirect to https for all pages except for the 2 that you need (and any images, css, or other dependencies that can also remain HTTP).

Here's a link to get started: http://tinyurl.com/4lj4v5g.