Automatically redirect http to https in IIS.
Ritesh Singh
IIS doesn’t have a feature to redirect HTTP to https. One way to achieve this is by modifying IIS custom error page (403.4). 1. a. Create a file called SSLRedirect.asp in your webroot with the following content:<% Data = request.servervariables(”QUERY_STRING”) URL = replace(Data, “403;”, “”) URL = replace(URL, “http://”, “https://”) response.Status = “200 OK” response.redirect URL %> Or if you want to redirect it to a single URL, you can change those lines above with this instead <% Response.Redirect(”https://www.YourDomain.com/”) %>b. Or Create a HTML SSLRedirect.html file as shown below :