如何使用 apache .htaccess 隐藏某些文件类型? [英] How to hide certain file type using apache .htaccess?

查看:27
本文介绍了如何使用 apache .htaccess 隐藏某些文件类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经很久没有打开 .htaccess 文件了...

Its been a long time since I've needed to crack open an .htaccess file...

在整个站点中 40 倍阻止访问特定文件扩展名的最简单方法是什么?

What is the simplest way to 40x prevent access to a specific file extension through out the entire site?

推荐答案

<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak)$">
Order Allow,Deny
Deny from all
</FilesMatch>

加载了一些常用扩展,根据需要添加更多.

Loaded with some common extensions, add more as you need.

这篇关于如何使用 apache .htaccess 隐藏某些文件类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆