当用户浏览https://
网址时,我尝试将我的apache服务器配置为重定向到http://
。
我在Google周围搜索过,但事情并不顺利。以下是我尝试过的内容:
Listen 443
….
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile "/usr/local/apache2/conf/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
SSLProxyEngine On
ServerAdmin webmaster@localhost
DocumentRoot /usr/local/apache2/htdocs
</VirtualHost>
ErrorLog /usr/local/apache2/logs/error.log
CustomLog /usr/local/apache2/logs/access.log combined
FallbackResource /index.html
使用此配置,这是浏览器响应:
################## Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
此外,我已尝试过这个:
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile "/usr/local/apache2/conf/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
SSLProxyEngine On
ServerAdmin webmaster@localhost
DocumentRoot /usr/local/apache2/htdocs
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
但无济于事(浏览器响应相同)。
我做错了什么?
由于
答案 0 :(得分:0)
在第二个例子中,我会说重写部分应该进入标准主机,*:80 ......
此外,可能错误消息来自没有准备好服务器的服务器,它至少可以通过http传递重定向...