【问题标题】:redirect to HTTPS between multiple domains在多个域之间重定向到 HTTPS
【发布时间】:2016-11-05 00:41:56
【问题描述】:

我有两个域(例如 domainone.com 和 domaintwo.com),它们指向一个网站。 我有一个 domainone.com 的 ssl 证书。

我想为 domainone.com 自动重定向到 https。 我不想为 domaintwo.com 自动重定向到 https,因为我没有此 domaintwo.com 的 ssl 证书。我只想用http打开它。

url rewrite (IIS) 中的规则如下。

Match URL – Requested URL: Matches the Pattern
Match URL – Using: Regular Expression
Pattern: (.*)

Condition Input: {HTTPS}
Check if input string: Matches the Pattern
Pattern: ^OFF$

Action type: Redirect
Redirect URL: https://{HTTP_HOST}/{R:1}
Redirect type: See Other (303)

现在两个域名都自动重定向到 https。请帮助我如何仅针对 domainone.com 自动重定向到 https。

谢谢。

【问题讨论】:

    标签: https url-rewriting iis-7.5


    【解决方案1】:

    我添加了一个条件。现在它可以按我的意愿工作了。

    Match URL – Requested URL: Matches the Pattern
    Match URL – Using: Regular Expression
    Pattern: (.*)
    
    Condition Input: {HTTPS}
    Check if input string: Matches the Pattern
    Pattern: ^OFF$
    Condition Input: {HTTP_HOST}
    Check if input string: Matches the Pattern
    Pattern: domainone.com
    
    Action type: Redirect
    Redirect URL: https://{HTTP_HOST}/{R:1}
    Redirect type: See Other (303)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-27
      • 1970-01-01
      • 2019-09-25
      • 1970-01-01
      • 2019-11-15
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      相关资源
      最近更新 更多