用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2961|回复: 0
收起左侧

[HELP] .htaccess 404和去掉index.php不能共存

[复制链接]
发表于 2011-4-15 22:56:49 | 显示全部楼层 |阅读模式
写了个.htaccess来用去掉Index.php 和定义404.
RewriteEngine On
ErrorDocument 404 /error.php

RewriteCond %{HTTP_HOST} ^test.com$ [NC]
RewriteRule ^(.*)$ http://www.test.com/$1 [L,R=301]

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


就这几行.加上
RewriteCond $1 !^(index.php|images|robots.txt)   
RewriteRule ^(.*)$ /index.php/$1 [L]
这两行可以去掉index.php,但不能显示自己的error.php,显示的是CI自己的error_404.php,去掉这两行可以显示error.php但index.php 又去不掉

请问各位大虾,什么原因呢?

本版积分规则