Reputation: 63
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
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.
Thanks in advance!
Upvotes: 1
Views: 481
Reputation: 456
I think this plugin will be helpful for you,
http://wordpress.org/plugins/restricted-site-access/
Upvotes: 0
Reputation: 12469
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>
Upvotes: 1