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.

  • 1
    You should be able to set which protocol each site uses under its settings. Sep 28 '12 at 10:48

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.


Yes, if you select the Site in IIS and in the Action pane on the right hand side select Bindings and then bind the site to the port 443(HTTPS).

You can then go to the SSL Settings icon and select Require SSL and then add a certificate to the website.

It is worth noting you can only have a single HTTPS website per IP address on a box unless you use a reverse proxy like Pound.

  • 2
    You can also bind multiple IP addresses to a single network interface if you need more https web sites.
    – jftuga
    Sep 28 '12 at 12:35
  • I don't think this solves the problem. I'm edited the question to try and be clearer. Oct 1 '12 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.