在codeIgniter_2.1.4删除的index.php [英] Remove index.php in CodeIgniter_2.1.4
问题描述
我是新手在 codeigniter
,并尝试配置 codeigniter
。
I am newbie in Codeigniter
and trying to configure Codeigniter
.
但我无法删除的index.php
从网址..
But i am unable to remove the index.php
from url..
我用下面这是在userguide ..
I changed the .htaccess
file by following data which was given in userguide..
.htacess文件包含
.htacess file contains
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
和也改变了配置文件
$config['index_page'] = '';
当我尝试使用下面的链接它会导致
when i try to use the following url it results
所请求的网址/ codeigniter /页/视图在此服务器上找到。
http://localhost/codeigniter/pages/view
但我尽量用的index.php在url..The网页正常显示。
But i try with index.php in url..The page shown normally..
http://localhost/codeigniter/index.php/pages/view
是这样的.htaccess问题还是我必须要改变一些其他文件。
如何摆脱这个问题?
任何建议,可以接受的。
Any Suggestions, acceptable.
更新
我在使用Ubuntu 3.10
I am using ubuntu 3.10
我用下面的命令来启用模块重写
I used the following command to enable module rewrite
sudo a2enmod rewrite
结果如下
Module rewrite already enabled
我改变了权限
I changed the permissions in
/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>
更改该文件还没有运气之后..
After changing this file also no luck..
推荐答案
终于让我找到了答案,我question.As下面的.htaccess解决我的问题。
Finally i found the answer to my question.As the below .htaccess solved my problem..
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php)
RewriteRule ^(.+)$ index.php?/$1 [L,QSA]
</IfModule>
感谢所有..
Thanks to all..
这篇关于在codeIgniter_2.1.4删除的index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!