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!
You almost had it, you had the allow and deny the wrong way around
I think this plugin will be helpful for you,
http://wordpress.org/plugins/restricted-site-access/