问题描述
我从来的。
现在我想这个重定向当用户在https协议工作。这意味着从重定向到的。
可能吗?
如果没有,我怎么重定向来的或
I have a redirect from http://example.com to http://www.example.com.now i want this redirect to work when the user is in https protocol. meaning to redirect from https://example.com to https://www.example.com.is it possible?if not, how do i redirect https://example.com/page to http://example.com or http://www.example.com
我希望我是清楚的。
推荐答案
从 https://example.com
重定向到 https://开头www.example.com
以相同的方式工作从 http://example.com
重定向到 HTTP:/ /www.example.com
,但你必须把重写规则在启用SSL的虚拟主机
除了你的普通HTTP 虚拟主机
部分。
Redirecting from https://example.com
to https://www.example.com
works in the same way as redirecting from http://example.com
to http://www.example.com
, except that you have to put the rewrite rules in your SSL-enabled VirtualHost
in addition to your plain HTTP VirtualHost
section.
在那里你可以得到一个问题是,对于这个工作,你需要 https://example.com
初始连接工作,由接受浏览器。对于这一点,你需要你的证书有效期为 www.example.com
和 example.com
。这通常是通过在服务器证书使用多个主题备用名称做了(你应该能够通过查看证书的详细信息,了解这一点)。有些CA发放证书,既没有在 WWW。
preFIX。
Where you may get a problem is that, for this to work, you need the initial connection to https://example.com
to work and be accepted by the browser. For this, you need your certificate to be valid for both www.example.com
and example.com
. This is typically done by using multiple Subject Alternative Names in your server certificate (you should be able to see this by looking at the details of your certificate). Some CAs issue certificates both with and without the www.
prefix.
这篇关于Apache的重定向页面时SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!