我已经搜索了这个问题,但没有答案可行我。如何使用.htaccess强制重定向到除一个文件夹之外的HTTPS?
我想重定向我的整个网站从HTTP到HTTPS除了文件夹/游戏/中的项目。
我想对/ games /做相反的处理,从HTTPS重定向到HTTP。
这是我试过但它只是显示一个无限循环。
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !games [NC]
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我试过[this](https://stackoverflow.com/questions/17638645/force-https-except-for-one-directory),但它不工作 - > RewriteEngine在 RewriteCond%{HTTPS} off RewriteCond%{REQUEST_URI}!游戏[NC] RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R = 301] – leonylyner