删除codeigniter的index.php文件 [英] Remove index.php of codeigniter

查看:167
本文介绍了删除codeigniter的index.php文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,这一个又一个。我用尽了一切我能找到的,没有运气搜索。

在我的httpd.conf(运行CentOS的和apache2的):

 <虚拟主机*:80>
服务器名www.domain.com
ServerAlias​​ domain.com * .domain.com
DocumentRoot的/var/www/html/domain.com
< /虚拟主机>

在我/var/www/html/domain.com htaccess的:

  RewriteEngine叙述上
的RewriteCond $ 1 ^(指数\\ .PHP |图片|机器人\\ .txt)的!
重写规则^(。*)$的index.php / $ 1 [L]

一切似乎是工作。

我已经尝试添加

 的RewriteBase /

我试过的最后一行切换到:

 重写规则^(。*)$ /index.php/$1 [L]


解决方案

您需要确保在您的虚拟主机,你有:

 <目录/path...to目录>
        为了允许,拒绝
        所有允许
        所有的AllowOverride
    < /目录>    < IfModule mod_rewrite.c>
        RewriteEngine叙述上
    < / IfModule>

Yes, another one of these. I've tried everything I could find on the search with no luck.

In my httpd.conf (running centos and apache2):

<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com *.domain.com
DocumentRoot /var/www/html/domain.com
</VirtualHost>

in my htaccess in /var/www/html/domain.com:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

Nothing seems to be working.

I've tried adding

RewriteBase /

I've tried switching the last line to:

RewriteRule ^(.*)$ /index.php/$1 [L]

解决方案

You need to make sure that in your virtual host you have:

    <Directory "/path...to directory">
        Order allow,deny
        Allow from all
        Allowoverride all
    </Directory>

    <IfModule mod_rewrite.c>
        RewriteEngine on
    </IfModule>

这篇关于删除codeigniter的index.php文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆