【发布时间】:2013-03-22 07:07:01
【问题描述】:
我想从 CI 的文件路径中删除 index.php 文件。我正在使用 ubuntu 12.04 。我尝试了几乎所有的论坛结果,但没有成功。
我将 CI 文件夹放在此路径。
http://localhost/xxx/CI/
我有 apache rewrite mod enable 。
sudo a2enmod rewrite
Module rewrite already enabled
我的 conf.php 文件中也有这个
$config['uri_protocol'] = 'AUTO';
$config['base_url'] = 'http://localhost/xxx/CI/';
$config['index_page'] = '';
$config['index_url'] = '';
我的 .htaccess 文件中有这个
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
.htaccess 文件位于此路径
http://localhost/xxx/CI/.htaccess
它也可以通过 apache 启用
/etc/apache2/sites-available/default
AllowOverride All
当我访问这样的文件时出现此错误
http://localhost/xxx/CI/login/
404 Error
The requested URL /xxx/CI/login/ was not found on this server.
任何帮助将不胜感激。
谢谢
【问题讨论】:
-
您是否收到 404 错误?你的
.htaccess文件在哪里? -
是的,麦克我得到 404 错误。我的 .htaccess 文件位于此路径 localhost/xxx/CI/.htaccess
标签: php .htaccess codeigniter mod-rewrite