0

我通过 Code Igniter 创建了一个应用程序,并且在 xampp 中一切正常。但是当我在我的网络服务器(Hawkhost)上启动它时,我收到了这个错误:

Fatal error: Class 'MY_controller' not found in /home/deremoec/public_html/an.deremoe/application/controllers/search.php on line 5

我已经将 base_url 从 webhost 重命名为我的域。

我还将我的 .htaccess 重命名为当前的网络服务器文件夹。

为了清晰的理解

$config['base_url'] = 'http://an.deremoe.com/';

我的 .htaccess

RewriteEngine On

# Put your installation directory here:
# If your URL is www.example.com/, use /
# If your URL is www.example.com/site_folder/, use /site_folder/

RewriteBase /an.deremoe/

# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L] 
4

2 回答 2

3

这确实是区分大小写的问题,就像zourite所说的那样。这里的问题是,您必须命名文件MY_Controller.php和类MY_Controller。注意大写的“C”。

于 2012-07-06T14:11:59.507 回答
0

您似乎http://an.deremoe.com/正在浏览器中访问您的网站。但是您使用的 RewriteBase 会将其放在http://whatever.com/an.deremoe/.

尝试将您的 RewriteBase 更改为/

于 2012-07-06T13:57:36.760 回答