How to redirect http to https

Build a simple html page and name it something like "redirect.html" containing the following script:
<SCRIPT type=text/javascript> <!-- if (location.protocol != 'https:') {window.location = 'https://'+ location.host + location.pathname + location.search; //alert(location.host + location.pathname + location.search); Just for sanity check}// --> </SCRIPT>

And in IIS snap-in, click on web site properties, select custom errors tab, and replace 403;4 with the location of the redirection html page you created with the code above.