从http重定向到https重定向中排除编码器URL模式



我有一个codeigniter项目。下面是它的。htaccess文件:

RewriteEngine on
#HTTPS redirection    
RewriteCond %{HTTPS} =off
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#CodeIgniter Rules
RewriteCond $1 !^(index.php|css|img|js|fonts|robots.txt|favicon.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

基本上我重定向所有非https流量到https。我的问题是我要从这个重定向中排除一个编码器控制器及其所有url 。一些控制器URL结构如下:

http://example.com/external/?url=blablabla
http://example.com/external/
http://example.com/external/out/543260
http://example.com/external?goto=blablablabla

这些是编码器url。它们不是文件或目录。我已经尝试了所有可能的rewritecsecond来排除这些url,但它不起作用。

如何从HTTP -> HTTPS重定向中排除这些编码器路由的url ?

我想我知道问题在哪里了。/external/是一个编码器模块,因此,它被重写为/index.php?/外部。php被重写为HTTPS,这就是它被重写为HTTPS的原因。我只需要排除index。php?

最新更新