I'm using a tool called : ISAPI Rewrite 3 Lite from Helicon Tech (an "apache .htaccess mod_rewrite compatible module for IIS").
I've applied the "Redirecting non-www version to www" rule (from : http://www.helicontech.com/isapi_rewrite/doc/examples.htm#hotlinking ). i.e. :
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
This works ok, but I have a slight problem with browser warnings when used with SSL. Say I want a url request like : https://MyDomain.com/abc/login.aspx to be re-directed to : https://www.MyDomain.com/abc/login.aspx The browser will show a warning like : "The security certificate presented by this website was issued for a different website's address." This makes sense because our SSL certificate only works for "www.MyDomain.com" (and not "MyDomain.com"). If you click "Continue to this website ?" it redirects fine to the required url, and all is well.
My question : is there something that can be done to make the browser SSL certificate warning NOT come up ? (Preferably without having to change the SSL certificate).
Thanks.
EDIT :
I was hoping that there was some way to get ISAPI Rewrite to change the url, so that IIS does not "see" the request to : "MyDomain.com", and only sees the altered request to : "www.MyDomain.com" (so that the SSL certificate warning would not occur). I thought it might have been a timing issue of sorts. But it looks like the timing of events is fixed, so that IIS will always check the SSL certificate in the context of the original request ? Can anyone confirm this ?