用WordPress重写mod_
我发现很难理解为什么下面的方法不起作用用WordPress重写mod_,wordpress,mod-rewrite,Wordpress,Mod Rewrite,我发现很难理解为什么下面的方法不起作用 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^category/.+$ category_display.php [L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^category/.+$ category_display.php [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
重新启动发动机
重写基/
重写规则^category/+$category\u display.php[L]
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
如果我把第二条规则(WordPress)注释掉,它就会起作用。我的理解是,如果找到匹配项,[L]
将终止
有人能解释一下吗?好的,刚刚做了一些研究,找到了答案。作为测试,我只是编了一个文件名,希望它抛出一个错误,说文件不存在。但是读了以后我发现了-f和-d检查文件是否存在,这就是它抛出自定义wordpress 404的原因