【发布时间】:2016-08-15 20:26:56
【问题描述】:
我之前用小写的控制器文件名,
但是,最近将文件移动到其他需要控制器名称以大写开头的服务器
==========================================
这里是重命名示例:
文件名: Home.php
$route['default_controller']: "home";
链接: http://example.com/index_folder/
===========================================
显示错误
Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.
当我将路线更改为
$route['default_controller']:“首页”;
它仍然显示相同的错误,
只有我去才会成功
http://example.com/index_folder/Home/
如何解决这个问题?感谢您的帮助
更新
这是 htaccess 文件,位于项目文件夹的根目录:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
重命名的原因是如果我的Controller是小写的,新服务器似乎有问题
【问题讨论】:
-
你想在这里实现什么?在配置文件中使用小写字母很好。你那里有带 mod rewrite 的 htaccess 吗?
-
可疑的 Home.php 里面有没有索引功能?
-
有索引功能
标签: php codeigniter path routes frameworks