【发布时间】:2015-08-07 18:59:53
【问题描述】:
它可能是关于 Codeigniter + 404 页面错误的旧的和常规的查询。我已经尝试从以前的 stackoverflow 问题中回答这个问题。但是,我无法解决我的问题。
我已将 Codeigniter 项目从另一个系统(Ubuntu OS 64 位)复制到 Ubuntus OS 系统。但是,我默认得到 404 页。如果我给 http://localhost/project/index.php/admin/login 它的工作但不是 http://localhost/project/admin/login 或 http://localhost/project。
这是我的配置:
config.php
$config['base_url'] = 'http://localhost/html/project';
$config['modules_locations'] = array(
APPPATH.'modules/' => '../modules/',
);
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
还有我的 .htaccess 文件:
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
【问题讨论】:
-
我也试过
a2enmod rewrite -
你重启服务器了吗?
-
使用 vhost 配置,使用 hosts 文件设置本地域并尝试一次。然后将基本 url 保留为空白。
标签: php apache .htaccess codeigniter codeigniter-3