Step 1 In IIS6, check "Require Secure Channel (SSL)" in the editing of Site Properties ->Directory Security ->. Step 2 Open the root directory of your website, such as d: webroot, and create a new file named https.htm in the root directory. The contents are as follows: <html> <head><title>Redirecting...</ title></head> <script language="JavaScript"> function redirectHttpToHttps() { var httpURL= window.location.hostname + window.location.pathname + window.location.search; var httpsURL= "//" + httpURL; window.location = httpsURL; } redirectHttpToHttps(); </script> <body> </body> </html>
Step 3 In IIS6, the site attribute ->Custom error ->Select 403.4 ->Modify the file path to d: webroothttps.htm |