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

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

问题描述

我试图通过操纵 URL 来拒绝用户访问 site/includes 文件夹.

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.

具体示例:我不想通过在 URL 中输入 localhost/site/includes 来查看目录文件.

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

推荐答案

创建 site/includes/.htaccess 文件并添加这一行:

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

Deny from all

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

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