重写规则以在 HTTP 和 HTTPS 上工作
我有这个简单的重写规则,并且它在 http 下正常工作:
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
但是,当我在 https 上时,该规则不会生效。我将规则集修改为以下但无济于事。
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
如何使该规则同时适用于 http 和 https?如果我需要提供更多信息,请告诉我。
I have this simple rewrite rule and it works properly under http:
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
However, the rule doesn't take into effect when I was on https. I modified the rule set to the following but to no avail.
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
How can I make that rule to work both on http and https? Please let me know if I need to provide more information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Apache 使用不同的虚拟主机进行 ssl 配置:
此链接有一个在 Debian 上使用 SSL 配置 Apache 的示例,但应该很容易推断到您所在的任何平台 http://www.debian-administration.org/articles/349
Apache uses a different vhost for ssl configuration:
This link has an example for configuring Apache with SSL on Debian, but should be easy to extrapolate to whichever platform you are on http://www.debian-administration.org/articles/349