Automatically redirect http to https in IIS
|
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).
<%
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 :
<html>
<head>
<meta http-equiv="refresh" content="2;url=http://webdesign.about.com">
<title>New Page 1</title>
</head>
<body>
</body>
</html>
/SSLRedirect.asp OR /SSLRedirect.html
4. Still in the IIS MMC tool, select the properties for the custom error file you have createdpreviously (SSLRedirect.asp), go to the file security tab, click the edit button at the bottom in secure communications, and then UN-check “Require secure channel (SSL)” option.
|
Wednesday, 20 November 2013
Automatically redirect http to https in IIS
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment