【发布时间】:2016-11-23 14:03:35
【问题描述】:
我的 CodeIgniter 项目中有两个控制器。 - home.php -dashboard.php
由于某种原因,我的 htaccess 使dashboard.php 在我更改为以下内容时不可用:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci_intro/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L] # THIS LINE HERE
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
但是,当我将其更改为下面的代码时,home.php 不可用。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci_intro/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] # THIS LINE HERE
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
我不明白为什么,有人知道它为什么会这样做吗?
谢谢, 斯科特
【问题讨论】:
-
你能展示你的控制器和你的文件结构的截图吗?
-
试试,把home.php重命名为Home.php
标签: php .htaccess codeigniter codeigniter-3