<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [QSA,L]
<Files *>
Options -Indexes
</Files>
</IfModule>
我的.htaccess 如上。
想实现
http://域名/index.php/ddsd.
http://域名/ddsd.
这样应该是404的 ,但是返回200
http://域名/index.php/ddsd 这样就是404
设置 ErrorDocument 404 /index.html 也不行。
求助。。
已存在的两个rewrite:
把你服务器上不存在的目录和文件(本应404)都转交给index.php了,所以如果要处理的话,你只能改index.php中的逻辑,也就是你使用的框架的逻辑,而不是rewrite了.