http://www.codeproject.com/KB/web-se...curity_v2.aspx is a great module for switching between https and http in IIS.

With version 3 you might get the port number on the redirected url.
For example you get for unencrypted url
Code:
http://www.yoursite.com:8059/default.aspx
Which supposed to be
Code:
http://www.yoursite.com/default.aspx
To solve this problem define the encryptedUri and unencryptedUri. And thats without https or http. For example:

Code:
<secureWebPages mode="RemoteOnly" ignoreHandlers="WithStandardExtensions" encryptedUri="www.yoursite.com" unencryptedUri="www.yoursite.com" maintainPath="True">
................
................
</secureWebPages>