【发布时间】:2014-04-09 03:17:38
【问题描述】:
我是Codeigniter 的新手,正在尝试配置Codeigniter。
但我无法从 url 中删除 index.php..
我按照用户指南中给出的数据更改了.htaccess 文件..
.htacess 文件包含
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
还修改了配置文件
$config['index_page'] = '';
当我尝试使用以下网址时,结果
在此服务器上找不到请求的 URL /codeigniter/pages/view。
http://localhost/codeigniter/pages/view
但我尝试在 url 中使用 index.php..页面正常显示..
http://localhost/codeigniter/index.php/pages/view
是 .htaccess 的问题还是我必须更改一些其他文件..?
如何解决这个问题?
任何建议,可接受。
更新
我使用的是 ubuntu 3.10
我使用以下命令启用模块重写
sudo a2enmod rewrite
结果如下
Module rewrite already enabled
我更改了权限
/etc/apache2/sites-enabled/000-default
作为
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
更改此文件后也没有运气..
【问题讨论】:
标签: php .htaccess codeigniter ubuntu