我已經搜索了這個問題,但沒有答案可行我。如何使用.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