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.pathname +; //alert( + location.pathname +; 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.