December 28th, 2012, 12:02 AM
Join Date: Nov 2012
Time spent in forums: 1 h 26 m 46 sec
Reputation Power: 0
Advice on securing a template page in WordPress using .htaccess
I have a localhost WordPress (WP) install running on Mac OS 10.7.5 via MAMP:
PHP 5.2.17 & 5.4.4
XCache 1.2.2 & 1.3.2
YAZ 4.0.1 & PHP/YAZ 1.1.3
These are my installed plugins:
Page Security by Contexture
I am using Twenty Eleven with a custom child theme. I want to secure a given page with URL http://localhost/wordpress/?page_id=2 which was created using a default sidebar-page.php template, or a custom template.
In other words I would like to use .htaccess to secure this page which contains a simple text-field form (.htaccess is the best way I know of working with my custom form); for example when I try to secure <Files wp-login.php> it works fine and a custom login appears for a username. I can also take my form, embed it in a PHP web page outside of WordPress and secure it using .htaccess...but then I lose my header, menu and footer.
*But* when I create a custom template and secure it using <Files custom-template.php> within a .htaccess file I am still able to type in data into the form and there is no prompt for login--in other words the page is unsecured.
I've search the forum, the WP forum and Google with no luck. It's not clear how a custom template, or the sidebar-page.php template can be secured. If that's not possible, I'm wondering how to create a new page (i.e. without using WP "Pages") that can be made to look like a page within WP. In other words, how could I add the header.php file and the main menu to a page outside of WP, or is that even worth the effort?
Advise is greatly appreciated.