为什么不在Codeigniter中显示控制器?

时间:2014-11-16 15:52:11

标签: php .htaccess codeigniter

我从GitHub更新了Codeigniter: https://github.com/bcit-ci/CodeIgniter/tree/feature/session

config.php文件中有行:

$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

档案.htaccess:

AddDefaultCharset utf-8
RewriteEngine On

RewriteBase /
DirectoryIndex index.php index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

当我打开URL www.site.com时,我收到消息:

404 Page Not Found

The page you requested was not found.

我也尝试过控制器:

index.php/articles/test

1 个答案:

答案 0 :(得分:0)

您是否使用xampp在localhost上运行此版本? 我让我的工作方式如下:

$config['index_page'] = '';

和我的.htaccess

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