首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重定向至多个域之间的HTTPS

问重定向至多个域之间的HTTPS
EN

Stack Overflow用户
提问于 2016-11-04 16:20:59
回答 1查看 348关注 0票数 1

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

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

url重写(IIS)中的规则如下。

代码语言:javascript
复制
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。请帮助我如何做,以自动重定向到https只有domainone.com。

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2016-11-05 00:41:57

我加了一个条件。现在它可以像我想要的那样工作了。

代码语言:javascript
复制
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)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40418064

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档