我在.htaccess
引起的error.log中出现此错误:
AH00665: RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.
它说什么?如何解决?
这是.htaccess
档案:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ %{REQUEST_URI}.php [L]
根据error.log,第11行是导致问题的原因:
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
答案 0 :(得分:0)
基于@anubhava建议我已从第11行删除了[NC]
,错误消失了。