WordPress.org

Ready to get started?Download WordPress

Forums

Secure a page using .htaccess file when URL includes "?page_id=2" (3 posts)

  1. TomR.
    Member
    Posted 1 year ago #

    All-
    I have a localhost install running on Mac OS 10.7.5 via MAMP:
    Apache 2.2.22
    MySQL 5.5.25
    PHP 5.2.17 & 5.4.4
    APC 3.1.9
    eAccelerator 0.9.6.1
    XCache 1.2.2 & 1.3.2
    phpMyAdmin 3.5.1
    SQLiteManager 1.2.4
    Freetype 2.4.8
    t1lib 5.1.2
    curl 7.24.0
    jpeg 8d
    libpng-1.5.7
    gd 2.0.34
    libxml2 2.7.8
    libxslt 1.1.26
    gettext 0.18.1.1
    libidn 1.17
    iconv 1.14
    mcrypt 2.6.8
    YAZ 4.0.1 & PHP/YAZ 1.1.3

    These are my installed plugins:
    Akismet
    BackUpWordPress
    Custom MetaWidget
    Duplicator
    Page Security by Contexture
    Role Scoper
    WordPress Importer
    HTTP Authentication

    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 stock WordPress site admin and 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-based form; for example when I try to secure <Files wp-login.php> it works fine and a custom login appears for a username. 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 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 secured.

    Thanks,
    Tom

  2. TomR.
    Member
    Posted 1 year ago #

    Note: I can also take my form, embed it in a PHP web page outside of WordPress and secure it using .htaccess. And then of course I lose my WP header, menu and footer.

  3. TomR.
    Member
    Posted 1 year ago #

    Solution: secure the page with Role Scoper plugin. Use .htaccess to authenticate/block the WP user its self from gaining login access to WP.

Topic Closed

This topic has been closed to new replies.

About this Topic