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

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

问题描述

是的,其中的另一个.我已经尝试了所有可以在搜索中找到的东西,但都没有运气.

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

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

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>

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

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

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

似乎没有任何效果.

我试过添加

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天全站免登陆