Apache的重定向页面时SSL

Apache的重定向页面时SSL

本文介绍了Apache的重定向页面时SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来的。
现在我想这个重定向当用户在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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:57