richardw 发表于 2012-9-26 11:42:17

想在CI目录中加入一个不需要CI处理的PHP文件来做一些特殊...

想在CI目录中加入一个不需要CI处理的PHP文件来做一些特殊的数据接收工作,但总提示404

我有做Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\\.php|images|system|robots\\.txt|insert\\.php)
RewriteRule ^(.*)$ ci/index.php/$1
</IfModule>

其中insert.php就是不想要CI处理的文件
这种情况应该如何处理下呀?

zhouli520 发表于 2012-9-26 12:19:55

insert.php放在项目根目录里面

richardw 发表于 2012-9-26 13:09:40

是在CI目录下,应该就是根目录吧,和index.php在一起,没其他PHP文件了{:1_1:}

kissgxd 发表于 2012-9-27 08:45:49

不需要rewrite啊,直接访问就OK
用不用CI处理主要看你访问的时候加没加index.php

大道达人 发表于 2012-9-27 12:42:54

直接输入URL

richardw 发表于 2012-9-28 04:23:09

楼上两位,我的Rewrite就是省略index.php的处理:L
直接输入URL:
localhost/ci/insert.php
会提示404
输入URL:
localhost/ci/index.php/insert.php更不行了,本来不需要CI处理的

richardw 发表于 2012-10-1 15:03:30

CI是不允许有这种文件存在吗?各位有碰到这种情况么,是怎么处理的?:L

richardw 发表于 2012-10-6 15:32:53

现在还有人在用CI吗?:L

浪迹天涯 发表于 2012-10-16 09:42:37

RewriteCond $1 !^(index\\.php|images|system|robots\\.txt|insert\\.php)为什么加2个\\呢?

把insert.php放到和index.php同级目录,.htaccess中应该是
RewriteCond $1 !^(index\.php|images|system|robots\.txt|insert\.php)

本人测试是可以的

richardw 发表于 2012-10-24 10:18:28

你再看一下我一楼的内容,和你发的是一样的呀

RewriteCond $1 !^(index\\.php|images|system|robots\\.txt|insert\\.php)
页: [1]
查看完整版本: 想在CI目录中加入一个不需要CI处理的PHP文件来做一些特殊...