4
目前,在我的生产服务器上,我有如下的入站规则集,它可以满足我所有的要求。在IIS中添加入站规则[UrlRewite]
入站规则如下。
Match URL section
Requested URL: Matches the Pattern
Using: Regular Expression
Pattern: (.*)
Ignore Case: checked.
Conditions section
Logical grouping: Match All.
Input: {HTTPS}
Type: Matches the Pattern
Pattern: ^OFF$
Track capture groups across conditions: unchecked.
Action section:
Action type: Redirect
Redirect URL: https://www.domainname.com/{R:0}
Append query string: checked.
Redirect Type: Permanent (301).
我的要求是: 当用户键入
https://beta.domain.com it should redirect to https://www.domain.com.
如果用户类型
http://beta.domain.com it should redirect to https://www.domain.com.
如果用户键入
http://www.domain.com it should redirect to https://www.domain.com
如果用户键入
http://domain.com it should redirect to https://www.domain.com
在此先感谢。 任何帮助,将不胜感激。
在此先感谢。
感谢Marco,我加了你的帮助!!!但这并不能满足我的要求。请在我的主要问题中检查我的要求。我已经更新了“需求”部分,更加清晰。 在此先感谢。 – shakti
我认为它满足您的所有要求,但这是由于HTTPS的本质。如果您的SSL证书是“* .domainname.com”的通配符证书,或者它是“www.domainname.com”和“beta.domainname.com”的多域证书,则您的第一项要求才可用。如果您的证书仅对'www.domainname.com'有效,则当您打开“https:// beta.domainname.com”时,它会导致浏览器显示安全警告。没有什么是你或IIS可以做的。 –