Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess使用require apache 2.4允许/拒绝ip_.htaccess - Fatal编程技术网

.htaccess使用require apache 2.4允许/拒绝ip

.htaccess使用require apache 2.4允许/拒绝ip,.htaccess,.htaccess,我的托管提供商最近将服务器更新为Apache 2.4,通过.htacces文件控制对特定文件夹访问的规则不再适用于以下代码: Order Deny,Allow Deny from All Allow from 123.123.123.123 Allow from 123.123.123.123 Allow from 123.123.123.123 在阅读了Apache 2.4文档之后,我明白我应该使用以下内容: <RequireAny> Require ip 123.123

我的托管提供商最近将服务器更新为Apache 2.4,通过.htacces文件控制对特定文件夹访问的规则不再适用于以下代码:

Order Deny,Allow
 Deny from All
 Allow from 123.123.123.123
 Allow from 123.123.123.123
 Allow from 123.123.123.123
在阅读了Apache 2.4文档之后,我明白我应该使用以下内容:

<RequireAny>
Require ip 123.123.123.123
Require ip 123.123.123.123
Require ip 123.123.123.123
</RequireAny>

要求ip 123.123.123.123
要求ip 123.123.123.123
要求ip 123.123.123.123

但它不起作用。有谁能帮我弄清楚吗?谢谢大家!

对于2.4,它现在看起来像这样:

<RequireAll>
Require all denied
Require ip 123.123.123.123
Require ip 123.123.123.123
Require ip 123.123.123.123
</RequireAll>
描述对现有Apache HTTP服务器用户至关重要的信息的文档


您好,谢谢您的快速回答。我在wp admin文件夹中的.htaccess文件中使用了您建议的代码,以阻止对文件中列出的ip以外的任何ip的访问,但仍然无法从任何提到的ip访问wp admin连接。我还缺什么?谢谢。嘿@AlbertoEstévezdeCastro,我刚看了一眼。使用2.4,您应该能够将
要求的ip 123.123.123.123
添加到.htaccess文件中。因此,这意味着它需要xyz地址才能访问。请参阅我对答案的编辑。Hi thickguru,事实上,这是我在阅读了我的提供商介绍给我的Apache2.4文档后的第一个方法,但也没有运气。我迷路了。如果你还有别的想法,请告诉我。谢谢。@AlbertoEstévezdeCastro查看此链接。这是一个描述升级关键信息的文档,第一部分是允许拒绝等,以及它是如何更改的。我还将把它添加到我的答案中。我希望这能帮上忙。嗨,抱歉等了这么久。我的托管服务告诉我,由于启用了NginX,它无法工作。(不知道这是什么)他们正在努力让它在启用NginX的情况下工作,所以不管它是什么,我想启用它似乎很重要。目前,为了让它正常工作,主机it人员已经禁用了NginX。
Require ip 123.123.123.123
Require ip 123.123.123.123