我如何在htaccess文件标签中添加多个文件?下面的代码适用于一个文件。
<Files wp-login.php>
Order Deny,Allow
Allow from 191.211.9.1
Deny from all
</Files>
我最终使用了这个:<filesMatch "^(wp-login|wp-file)\.php$">
Order Deny,Allow
Allow from 190.190.0.1
Deny from all
</filesMatch>
我如何在htaccess文件标签中添加多个文件?下面的代码适用于一个文件。
<Files wp-login.php>
Order Deny,Allow
Allow from 191.211.9.1
Deny from all
</Files>
我最终使用了这个:<filesMatch "^(wp-login|wp-file)\.php$">
Order Deny,Allow
Allow from 190.190.0.1
Deny from all
</filesMatch>
尝试像这样做(未经测试但应该可行):
<Files ~ "^(admin|wp-login|one-more-file)\.php$">
或者这个:
<FilesMatch "^(admin|wp-login|one-more-file)\.php$">
以下是一些可行的选择:
"Forbidden"
:在这种情况下,"用户"/"黑客"/"对手"/"渗透测试人员"会发现这些文件存在于您的服务器上,但他/她无法访问它们!
<FilesMatch "(?:readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?)">
Require all denied
</FilesMatch>
"404"
:在这种情况下,"用户"/"黑客"/"对手"/"渗透测试者"理论上会认为这些文件根本不存在于您的服务器上!
<FilesMatch "(?:readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?)">
Redirect 404
</FilesMatch>
FilesMatch
代替:http://httpd.apache.org/docs/current/mod/core.html#filesmatch - LazyOne