如何使.htaccess无法访问目录

时间:2016-07-02 15:34:10

标签: php .htaccess

我试图将.htaccess文件放在给定目录中,但它似乎无法通过远程Web服务器运行。它在我的计算机上的WAMP中工作正常。

deny from all 
order deny,allow
Limit GET, POST

我想通过此网址无法访问Getthefiles目录:

http://pmln-hec.site88.net/Getthefiles/

apache版本是2.2.19,托管有000webhost。

1 个答案:

答案 0 :(得分:0)

您的布局有点不对,如果您想为特定文件执行此操作,那么您可以使用它:

<Files Getthefiles.html>
order deny,allow
allow from [your IP goes here]
deny from all
</Files> 

因此,这仍然允许从您自己的IP访问此目录,然后拒绝访问其他所有人。

另一个选择是您可以使用密码保护该目录。

相关问题