.htaccess 将整个站点从http重定向到https,一个页面除外
我想把我的整个网站从http重定向到https,除了一个页面(实际上是一个要下载的文件),但我遇到了麻烦 我目前正在使用.htaccess 将整个站点从http重定向到https,一个页面除外,.htaccess,.htaccess,我想把我的整个网站从http重定向到https,除了一个页面(实际上是一个要下载的文件),但我遇到了麻烦 我目前正在使用 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
从这个帖子
但是我还没有弄清楚如何排除我需要的一个文件
差不多
我试着将它的https版本重定向回http版本,但我得到了一个错误,它表明我处于一个无休止的解析循环中,无法工作
任何帮助都将不胜感激一个简单的mod_重写异常应该可以工作:
RewriteEngine On
RewriteCond %{REQUEST_URI} !/phone/version/currentversion.txt
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
没问题。听到这个消息我很高兴。:)