通过IP限制Wordpress页面


Restrict Wordpress Page by IP

我有一个WordPress网站,我想限制其中一个页面只能由特定的ip访问。这个页面是我WordPress主题的模板。模板的php文件名为alley.php

下面是我在模板目录 中放置的。htaccess文件中尝试的内容
<FilesMatch alley.php>
 Order Allow,Deny
 Allow from xxx.xxx.xxx.xxx
 Deny from all
</FilesMatch>

但是它不适合我。

提前感谢!

你差点就做到了,你把allow和deny用错了方法

<Files alley.php>
    order deny,allow
    deny from all
    allow from xxx.xxx.xxx.xxx
</Files>

我认为这个插件会对你有帮助,

http://wordpress.org/plugins/restricted-site-access/