我通过 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]