Results 1 to 9 of 9
  1. #1

    Best way to password protect a folder while wordpress is installed?

    Hello,

    I have been trying to password protect using my cpanel a folder, the problem is that wordpress 3.3.1 is installed in the root of the website and wordpress says error 403, the file page requested cannot be found. I suspect that wordpress permalink feature is causing the problem.

    Any idea how I could password protect a folder even with wordpress installed using permalink?

    Thank you,

    Ben

  2. #2
    Join Date
    Mar 2005
    Location
    Cardboard box
    Posts
    1,027
    I am not familiar with the cPanel function/feature, but would a simple password protection by .htaccess help?

  3. #3
    Hi Dale,

    Thanks for the reply

    I tried to create and .htaccess file in the folder:
    AuthUserFile /home/account_name/.htpasswd
    AuthGroupFile /dev/null
    AuthName EnterPassword
    AuthType Basic

    require user password_here


    and created a file called .htpasswd with the username and password.

    this is what I get when I try to access the file with protection


    Error 404 - Page Not Found
    Admin Help: Why am i seeing this page?

    This error 404 page means that for some reason the page could not be found or loaded correctly.

    It maybe that your Wordpress permalink cache needs refreshing, click this link to view your admin permalink structure then come back and refresh this page.

    If the error continues try checking your website link is correct in your browser window or re-creating the page from scratch.

    Note: You are seeing this page because you are logged into an admin account, normal website visitors will not see this message.


    Wordpress has rewrite rules in the .htaccess.How can I stop the rewrite rules for this folder? Any idea please?

    I need to tell wordpress to stop trying to rewrite this url, I believe this is the problem.


    Thanks,


    Ben

  4. #4
    Join Date
    Mar 2005
    Location
    Cardboard box
    Posts
    1,027
    After creating the file .htpasswd, did you run .htpasswd (the file) through htpasswd (the command) to create password?

    Like this:
    Code:
    htpasswd -c .htpasswd user_here
    (Note that the -c switch denotes creation, so if you don't want to create a new password file, you need not include the -c.)

  5. #5
    Hi Ben:

    If you are using the default .htaccess rules for WordPress, they should not cause issues with a folder underneath the WordPress root.

    You can test this out by renaming the .htaccess file to something else or otherwise commenting out the .htaccess rewrite entries.

    If you do find the rewrites where an issue, the rules in any .htaccess file typically follow through to folders underneath until overwritten by another .htaccess file in a folder below.

    Thank you.
    ---
    Peter M. Abraham
    LinkedIn Profile

  6. #6
    Join Date
    Feb 2010
    Location
    Worldwide
    Posts
    61

    Post

    Because WP runs through the index.php file password protection can be problematic.

    The solution is simple and in the form of a plugin. Try the plugin below and you'll be good:
    AskApache Password Protect

    If this doesn't work there are a couple others you can try.

  7. #7
    Join Date
    Jul 2005
    Posts
    489
    AFAIK, wordpress rules shouldnt cause any conflicts. Try renaming wp htaccess temporarily and then add protection from cpanel and see if it works.

  8. #8
    Thank you everyone,

    I will try all your solutions and see if one of them work.
    I will post back

    Thank you!

    Ben

  9. #9
    Join Date
    Jan 2006
    Location
    India
    Posts
    637
    The easiest one to try is using a wordpress plugin without worrying about htaccess issues.
    ►ExpertWebHost.NET- Instant reliable hosting since 2008+
    ►Quality Shared, Reseller, SEO and VPS hosting
    ►Choose to host from US/Uk/Canada/Singapore/Netherlands/Australia - 10 locations

Similar Threads

  1. Password protect a folder/whole external hard drive?
    By DWebby in forum Computers and Peripherals
    Replies: 12
    Last Post: 11-30-2014, 01:58 PM
  2. Hsphere password protect windows folder
    By muhan in forum Hosting Software and Control Panels
    Replies: 2
    Last Post: 11-12-2005, 07:08 AM
  3. Sending login and password to password protect dir using Php
    By joshuayip in forum Programming Discussion
    Replies: 5
    Last Post: 05-29-2005, 07:54 PM
  4. Replies: 0
    Last Post: 08-16-2002, 08:36 PM
  5. password protect a folder
    By sleggtools in forum Dedicated Server
    Replies: 2
    Last Post: 10-28-2001, 06:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •