拒绝访问在.htaccess中一个特定的文件夹 [英] Deny access to one specific folder in .htaccess

查看:494
本文介绍了拒绝访问在.htaccess中一个特定的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图拒绝用户访问网站/包括文件夹,通​​过操纵URL。 我不知道有没有否认一切,并手动进行个别例外,以允许,如果我可以否认这一个文件夹,或者如果有一个重写功能可以使用。

I'm trying to deny users from accessing the "site/includes" folder by manipulating the URL. I don't know if I have to deny everything and manually make individual exceptions to allow, if I can just deny this one folder, or if there's a rewrite function that can be used.

具体的例子:我不想通过键入看到目录中的文件本地主机/网站/包括进入网址

Specific example: I don't want to see the directory files by typing in "localhost/site/includes" into the URL.

推荐答案

创建网​​站/包括/的.htaccess 文件,加入这一行:

Create site/includes/.htaccess file and add this line:

Deny from all

这篇关于拒绝访问在.htaccess中一个特定的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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