【发布时间】:2015-06-02 17:12:56
【问题描述】:
我需要一些帮助来在我的免费主机上配置 Codeigniter。
我正在为我的网站使用 CodeIgniter 3.0 和 Hostinger。
我的 config.php 为:
$config['base_url'] = 'http://mysite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
我按照本主题所述配置 .htaccess:Codeigniter website 404 error / .htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
即使这样,我仍然会从 Codeigniter 中找到 404 页面,我错过了什么?或者我做错了什么?我是这方面的新手,所以如果您需要看其他内容,请告诉我,我会上传。谢谢!
编辑:我忘了提到在我的本地主机中工作,但在现场是当我得到 404 错误时。
【问题讨论】:
-
你能检查一下apache rewrite模块是否启用了吗?假设您使用的是 apache
-
在直接向 Hostinger 提出的问题中,它说 mod_rewrite 默认启用:hostinger.ph/knowledge-base/99.html
-
你设置了默认控制器吗?
-
是的。在本地主机上工作正常,但在现场它让我得到 404 错误。
-
您能看到您的 httpd.conf 的 DocumentRoot 和目录,或者更确切地说,这个特定网站的 Vhost 是什么?
标签: php .htaccess codeigniter hosting