我和正则表达式有点混淆使用<Files>
和<FilesMatch>
如果你看一下下面的规则,我已经对它们进行了一些修改,我不确定它是对的,哪些是错的。
# Deny access to all important files (Misc)
<FilesMatch "^\.*(error_log|bak|config|ini|log|sh|sql|swp|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$">
order deny,allow
deny from all
</FilesMatch>
# Deny access to all .htaccess files (Main)
<FilesMatch "\.htaccess">
order allow,deny
deny from all
</FilesMatch>
# Deny access to every type of .htaccess file (Extra check)
<FilesMatch "^.*\.([Hh][Tt][AaPp])$">
order allow,deny
deny from all
satisfy all
</FilesMatch>
# Deny access to every file EXCEPT the following (High Security)
Order deny,allow
Deny from all
<FilesMatch "^\.(xml|css|js|jpe?g|png|gif|xlsx|xls|xlsm|doc|docx|pdf)$">
Allow from all
</FilesMatch>
如果你看第一条规则,我不确定什么是正确的
"^\.*(error_log|bak|config|ini|log|sh|sql|swp|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$"
我应该只看扩展名吗?
php.ini和wp-config以及.htaccess实际上是否正常工作?因为这肯定是在寻找:.wp-config.php
例如显然是错误的。