Chr*_*lor 24
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)
加载一些常见的扩展,根据需要添加更多.
Art*_*cto 12
如果你真的想要404(而不是403),你可以使用mod_rewrite:
RewriteEngine on
RewriteRule \.ext$ - [R=404]
Run Code Online (Sandbox Code Playgroud)
<FilesMatch "\.ext$">
Deny from all
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)
See the Apache documentation on FilesMatch and Deny
EDIT: Artefacto makes a good point, this will return 403, not 404, if that's important for your purposes
| 归档时间: |
|
| 查看次数: |
18154 次 |
| 最近记录: |