0

Code Igniter を使用してアプリを作成しましたが、xampp ですべて正常に動作します。しかし、Web サーバー (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 の名前を現在の Web サーバー フォルダーに変更しました。

明確な理解のために

$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

これは、ゾーライトが言ったように、大文字と小文字の区別の問題です。ここでの問題は、ファイル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 に答える