I am having and problem using IIS Rewrite rules to handle all scenarios of redirecting an old domain to my newdomain and newly enforcing a SSL connection.
Here are the rules as I have them configured now.
So what does work is when a user enters in the old domain using http://
Also, If a use enters in the newdomain using http://
What does not work is when a user enters in the olddomain using https://
The user is presented with the error "SSL cert does not match the domain".
Any one have any thoughts on how to combine both these rules to handle all scenarios.
So things just started clicking in my brain and I believe I have found my own answer. The answer is I can't do it the way I am doing it.
I found the reason why in this post
Since the SSL handshake is done before any requests are made that would be handled by URL Rewrite module, I have to have both certificates active on the site. Now since this is IIS, and a ssl cert can only be assigned to a single IP, I am going to have to get a second public IP and assign the olddomain bindings to new ip and then the url rewrite rules as I have written should work.