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可以做的。 –