带子域的 IIS 重写(http 到 https)
我找到并尝试了这里找到的杰夫规则,但我可以'让它完全正常工作:
我需要的是让 http://abcom 转到 https://abcom (其中 a 不是 www,但这种区别不应该真正影响规则,不是吗?www 只是另一个子域,对吧?)
Jeff 有 (.*)billing/(.*) 的地方,我用 (.*) 替换,但这不起作用。
我尝试的结果产生“重定向循环”错误。
这种重写对我来说是新的。
感谢您的所有帮助。
I found and tried Jeff's rules found here but I can't get it to work exactly right:
What I need is to have http://a.b.com go to https://a.b.com (where a is not www, but that distinction shouldn't really affect the rule, should it? www is just another subdomain, right?)
Where Jeff has (.*)billing/(.*), I replaced with (.*), but that's not working.
The results of my attempts produce "redirect loop" errors.
This rewriting stuff is new to me.
Appreciate all your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该确保您的应用程序(发送到
http://abcom/
直接发送到https://abcom/
),而不是使用重定向,否则,相同请求将在重定向到 HTTPS 之前通过纯 HTTP 传输,这违背了这一点。(此这个其他问题了解更多详细信息.)
Rather than using redirections, you should make sure your application (that sends to
http://a.b.com/
sends tohttps://a.b.com/
directly), otherwise, the same request will go over plain HTTP before being redirected to HTTPS, which defeats the point.(This this other question for more details.)
好吧,这不完全是您要求的答案,但如果您有机会在 ASP.net 页面上使用它,您可以打开 Global.ASPX 文件,然后在“Application_BeginRequest”页面中输入:
Well not exactly the answer you are asking for, but if you by any chance are using this on an ASP.net page, you can open your Global.ASPX file and inside the "Application_BeginRequest" page you can put: