Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.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/8/vim/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
Php 模式重写对一个地址无效_Php_.htaccess_Codeigniter_Mod Rewrite - Fatal编程技术网

Php 模式重写对一个地址无效

Php 模式重写对一个地址无效,php,.htaccess,codeigniter,mod-rewrite,Php,.htaccess,Codeigniter,Mod Rewrite,我在htaccess文件中添加了一些规则,以便在CodeIgniter中从url中删除index.php。但是,对于一个地址,它不起作用 url是这样的“” 因此,当第二个uri为“subtitle”或“sub”时,它不会发送到“index.php”并直接读取不存在的文件夹 如果我更改第二个uri“”,它会工作 我真的很困惑 这是.htacce的代码: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCo

我在htaccess文件中添加了一些规则,以便在CodeIgniter中从url中删除index.php。但是,对于一个地址,它不起作用

url是这样的“”

因此,当第二个uri为“subtitle”或“sub”时,它不会发送到“index.php”并直接读取不存在的文件夹

如果我更改第二个uri“”,它会工作

我真的很困惑

这是.htacce的代码:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

重新启动发动机
重写基/
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php?/$1[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]

这是因为/

RewriteCond %{REQUEST_FILENAME} !-d
测试目录是否存在,不要重写。
您可以删除此条件。

谢谢。我删除了根目录中的一个.php文件,它成功了。似乎存在冲突,因为该文件的一部分名为“subtitle”。