Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 从http到https重定向中排除codeigniter URL模式_.htaccess_Codeigniter_Url Rewriting - Fatal编程技术网

.htaccess 从http到https重定向中排除codeigniter URL模式

.htaccess 从http到https重定向中排除codeigniter URL模式,.htaccess,codeigniter,url-rewriting,.htaccess,Codeigniter,Url Rewriting,我有一个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

我有一个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。我的问题是,我要从这个重定向中排除一个codeigniter控制器及其所有URL。一些控制器URL结构包括:

http://example.com/external/?url=blablabla
http://example.com/external/
http://example.com/external/out/543260
http://example.com/external?goto=blablablabla
这些是codeigniter URL。它们不是文件或目录。我已经尝试了所有可能的重写,以排除这些网址,但它不工作


如何从HTTP->HTTPS重定向中排除这些codeigniter路由URL

我想我知道问题出在哪里。/external/是一个codeigniter模块,因此,它被重写为/index.php?/external。php被重写为HTTPS,这就是它被重写为HTTPS的原因。我所要做的就是从HTTPS重写规则中排除index.php?/external。

尝试
RewriteCond%{REQUEST\u URI}^/外部/?url=blabla$
作为第一条规则之前的第二个条件。@Tpojka这不起作用。我认为问题在于/external/是codeigniter重新路由的路径,而不是服务器上的实际目录或文件。