Live Server上的Codeigniter 404错误

时间:2016-02-01 22:52:02

标签: php codeigniter server

我将控制器名称从controller.php更改为Controller.php 还将配置文件中的base_url更改为我的网站托管目录,如www.abc.com/websitefolder 但我仍然得到404错误 网址:www.cyfers.com/moving /

我的base_url:$config['base_url'] = 'http://www.cyfers.com/moving/';

我的.htaccess代码

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

enter image description here

1 个答案:

答案 0 :(得分:3)

您的基本网址应为

$config['base_url'] = 'http://cyfers.com/moving/';

在htaccss中

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

您的Controller文件应为dashboard.php

默认控制器应为$route['default_controller'] = "dashboard";

要在root中隐藏站点上的错误,请调用文件index.php

将此更改为

define('ENVIRONMENT', 'development');

define('ENVIRONMENT', 'production');