限制词preSS页通过IPpreSS、IP

由网友(孤煞)分享简介:我有一个字preSS网站,我想限制的一个页面上只有特定的IP地址来访问。该网页是我的字preSS主题的模板。模板的php文件被称为alley.php I have a WordPress website and I want to restrict one of the pages to be accessible...

我有一个字preSS网站,我想限制的一个页面上只有特定的IP地址来访问。该网页是我的字preSS主题的模板。模板的php文件被称为alley.php

I have a WordPress website and I want to restrict one of the pages to be accessible only by specific IPs. The page is a template for my WordPress theme. The php file of the template is called alley.php

下面是我试过的.htaccess文件,放置在模板目录

Here is what I tried in the .htaccess file, placed in the template directory

<FilesMatch alley.php>
 Order Allow,Deny
 Allow from xxx.xxx.xxx.xxx
 Deny from all
</FilesMatch>

但它不是为我工作。

but it's not working for me.

在此先感谢!

推荐答案

您几乎拥有了,你有允许和拒绝周围的错误的方式

You almost had it, you had the allow and deny the wrong way around

<Files alley.php>
    order deny,allow
    deny from all
    allow from xxx.xxx.xxx.xxx
</Files>
阅读全文

相关推荐

最新文章