某些版本的Chrome会自动将https添加到我的网站地址中。 所以我需要将httpsredirect到http,因为我没有SSL证书。 我正在尝试这个,没有结果:
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} =https RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule>
没有证书,浏览器就不能向服务器说HTTPS,而你的服务器从来没有机会回复301到浏览器。
简而言之,如果没有正确configuration包括证书的HTTPS服务器,则不能这样做。
使用.htaccess你可以做到httpsredirect到http
RewriteEngine On RewriteCond %{HTTPS} =on RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
要么
RewriteEngine On RewriteCond %{SERVER_PORT} ^443$ RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
但如果谷歌redirect到HTTPS,它会做一个redirect循环,所以你可能要find为什么交通redirect到HTTPS(也许caching,尝试从任何请求的其他浏览器干净)