当前位置: 动力学知识库 > 问答 > 编程问答 >

url rewriting - IIS 7 Rewrite Rule with SSL Redirect

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: