aniven 发表于 2012-3-25 21:15:56

坑爹啊,我也被难倒了,还是CI手册帮了忙,确实是htaccess写法有问题,论坛上复制的规则有两条斜杠,只要一条就行了,另外如果CI目录不是在根目录,只需要把RewriteRule ^(.*)$ /index.php/$1 中index.php前面的/去掉就行了。

RewriteCond $1 !^(index\\.php|images|robots\\.txt)

justdoit 发表于 2012-3-26 09:07:52

但是貌似很多人都没有遇到这种问题啊,就咱们两个遇到了???你的php环境是什么的?

huhe12319 发表于 2012-4-5 18:32:50

我用的是wamp 按照教程上出现500

直接
RewriteEngine on   
RewriteCond $1 !^(index\.php|skin|images|robots\.txt)   
RewriteRule ^(.*)$ /index.php/$1

教程是

RewriteCond $1 !^(index\\.php|skin|images|robots\\.txt)

就有问题

lynn.wang 发表于 2012-8-29 10:44:49

upload文件夹开放为可访问

傻瓜青蛙~~ 发表于 2012-10-19 10:56:45

justdoit 发表于 2012-3-6 09:41 static/image/common/back.gif
补充:就是出现这样的错误:Internal Server Error

The server encountered an internal error or misconfig ...

我也是啊

★暗光流影 发表于 2012-12-11 20:55:20

如果有多个入口文件,多个application文件,这个文件该如何写呢,比如说有两个index.php和admin.php

willke 发表于 2012-12-11 22:43:44

http.config 是否有书写错误了?

php_lover 发表于 2013-8-30 16:12:12

如果你的项目是通过虚拟主机配置的:

1)确认apache httpd.conf中已经开启rewrite模块(无#代表已开启)

LoadModule rewrite_module libexec/mod_rewrite.so

2)确认apache httpd-vhost.conf中DocumentRoot有访问权限,假设我的根目录是:"D:/xampp/htdocs/CodeIgniter"
   
   DocumentRoot "D:/xampp/htdocs/CodeIgniter"
   ServerName http://codeigniter.test.com-->url中要访问的域名
   <Directory "D:/xampp/htdocs/CodeIgniter">
      Options +Indexes +FollowSymLinks
      AllowOverride All -->不能是None,否则会报404
                Order allow,deny
                Allow from All -->不能是Deny from all,否则会报无权访问
    </Directory>
   
3)在如上根目录下建立.htacess文件,加入如下配置:

   <IfModule mod_rewrite.c>

    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^(.*)$ /index.php/$1

   </IfModule>
   4)重启apache ,开始测试吧。如:http://codeigniter.test.com/News/index

   5)说明:第2中的修改与httpd.conf文件无关,httpd.conf无须做任何更改。
         无需修改config.php中$config['index_page'] = 'index.php';
         此做法如果输入http://codeigniter.test.com/index.php/News/index也能访问,不过已经能实现去除index.php了。

   

页: 1 [2]
查看完整版本: rewrite去掉index.php出现错误