2016-04-21 86 views
1

我在htaccess中重写了以下URL重定向URLS首先https和其次如果它尚未。使用下面的代码:从SSL中排除特定的目录

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不会工作中连接到脚本。

回答

1

要HTTP重定向到https://www,并从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] 
+0

正是我一直在寻找,并很好地收拾起来。非常感谢@starkeen – CloudSurferUK

+0

如果我想添加第二个网址即action.php/fsfk我只是重新创建最后一行或者是否需要将它添加到最后一行if/else中? – CloudSurferUK