.htaccess拒绝所有人都行不通 [英] .htaccess deny from all doesn't work

查看:81
本文介绍了.htaccess拒绝所有人都行不通的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我想拒绝对文件夹的访问,但是我不能。
我已经在该文件夹中放置了 .htaccess 文件,其中包含以下几行:

my problem is that I want to deny the access to a folder but I can't. I've put a .htaccess file in this folder with just these lines:

order deny,allow
deny from all

任何想法

推荐答案

我明白了!这是由于apache配置。在我的sites-availables目录的 foo.conf 中,我有:

I get it! It was due to the apache configuration. In my foo.conf of sites-avaiables directory I had:

AllowOverride None

正如apache文件所说, AllowOverride描述:允许使用的指令类型。 htaccess文件

As apache doc says, AllowOverride Description: Types of directives that are allowed in .htaccess files

更改为:

AllowOverride All

它可以完美运行!
也可以使用特定选项进行配置:

it works perfectly! You can also configure it with specific options:

AllowOverride directive-type

指令选项位于: apache.org

这篇关于.htaccess拒绝所有人都行不通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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