我的根目录中有下一个htaccess:
# To externally redirect /dir/file.php to /dir/file
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(.+?)\.php[\s?]
RewriteRule ^ /%1 [R=301,L,NE]
# To internally forward /dir/file to /dir/file.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.+?)/?$ /$1.php [L,NC]
如何排除我的下一个子文件夹,http:// rootdir / demos?
答案 0 :(得分:1)
尝试在其他重写规则之前添加此内容:
RewriteRule ^(demos)($|/) - [L]
如果符合条件,它将停止重写