我已经设法通过 .htaccess 使用以下规则在 https 中切换我的所有网站:
RewriteCond %{HTTPS} off [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
现在我遇到了一个问题,因为一些 3rd 方服务使用 POST url,例如:
http://sub.mydomain.com/agreg/sms/service
被拒绝,因为它们被重定向并且现在 GET。
我想在每个带有^/agreg/
方案的 url 上禁用这个“强制 https”的东西。我试过了
RewriteCond %{HTTPS} off [NC]
RewriteCond %{REQUEST_URI} !^/agreg
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,QSA]
但现在有重定向到http://sub.mydomain.com/app.php
我在这里错过了什么?
非常感谢你的帮助!