我从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
答案 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]