我在 CodeIgniter 应用程序中有三个控制器-i和.logintest
/APP/index.php/所有控制器都与路径完美配合- 我可以打开/APP/index.php/i,/APP/index.php/login和/APP/index.php/test.
控制器i和login工作index.php也没有 -/APP/i和/APP/login(我有一个修改过的.htaccess文件)。
没有控制器test就无法工作index.php- 打开时出现 404 错误/APP/test。
i是默认控制器,但login不是默认控制器,它可以工作(我认为这可能是问题)。
当我添加第四个控制器时,没有index.php.
它变得更加奇怪 - 有时我可以打开/APP/test/some_function(有时我不能),然后我什至可以打开/APP/test. 但是我不能以这种方式再次打开它。index.php方式一直有效。Test控制器有一个非常简单的代码......
所以我的问题是这里可能会出现什么问题,我怎样才能让我的控制器在没有 的情况下可以访问index.php?
非常感谢您的帮助。
以下是我的.htaccess文件,我认为问题可能存在:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /APP/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>