限制词preSS页通过IP [英] Restrict Wordpress Page by IP

查看:199
本文介绍了限制词preSS页通过IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字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>

这篇关于限制词preSS页通过IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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