Sunday, March 20, 2016

Automatically redirecting HTTP to HTTPS in IIS

If you want to automatically redirect the HTTP version of a site to HTTPS (SSL) with IIS, you have a few options. One option would be to write up some code in Global.asax. Another option, if you would prefer to avoid writing new code, would be to take advantage of an optional IIS component.

That component is HTTP Redirection, under Common HTTP Features in the feature management dialog. Once that feature is installed, an entry called HTTP Redirect will appear in the IIS manager. The easiest way to use it to do the redirection is to create a new empty site, bind that to port 80, and set that feature on just the new site to serve a permanent redirect to the HTTPS version of the URL.

Settings that cause the site to redirect to https://example.com

No comments:

Post a Comment