Apache 从SSL中排除特定目录

Apache 从SSL中排除特定目录,apache,.htaccess,redirect,ssl,url-rewriting,Apache,.htaccess,Redirect,Ssl,Url Rewriting,我在htaccess中重写了以下URL,首先将URL重定向到https,然后再重定向到WWW(如果还没有)。使用以下代码: RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Rewrit

我在htaccess中重写了以下URL,首先将URL重定向到https,然后再重定向到WWW(如果还没有)。使用以下代码:

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^index.php/fsukblog/(.*)$ https://www.thisdomain.com/index.php/blog/$1 [L,R=301]
我想做的是从SSL中排除index.php/acars,这样它就可以通过http工作,因为第三方软件连接到acars中的脚本,并且不会通过SSL工作。

要将http重定向到,并从https重定向中排除/index.php/acars,可以使用

RewriteEngine on
RewriteCond %{HTTPS} OFF [NC]
RewriteCond www.%{HTTP_HOST} ^(?:www\.)?(www\..+)$ [NC]
RewriteRule !^index\.php/acars https://%1%{REQUEST_URI} [NE,L,R]

这正是我要找的,而且收拾得很好。非常感谢@starkee如果我想添加第二个url,即action.php/fsfk,我是只是重新创建最后一行,还是需要以if/else的形式将其添加到最后一行?