【发布时间】:2013-03-06 00:08:58
【问题描述】:
我已经设法通过 .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/ 方案在每个网址上禁用此“强制 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
我错过了什么?
非常感谢您的帮助!
【问题讨论】:
标签: apache .htaccess https url-rewriting