Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Problem with .htaccess password protect

  • 10-01-2011 4:35pm
    #1
    Registered Users, Registered Users 2 Posts: 1,657 ✭✭✭


    I have a Wordpress site and contained within the directory structure is a test version of the site, but I don't want normal users to have access to the test one so I'm putting in a password protection using .htaccess

    I have added the following lines to my .htaccess, within the test directory

    AuthUserFile /home/myhomedir/.htpasswd
    AuthGroupFile /dev/null
    AuthName "testserver"
    AuthType Basic
    require valid-user

    ...and added into the "root" (i.e. of my home dir) a .htpasswd file contaning a single line in the form

    username:encryptedpassword

    However, now when I browse to the test site directory, instead of being prompted for a username/password I'm just redirected to the standard "page not found" file.

    Any ideas what could be wrong?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,345 ✭✭✭Kavrocks


    If you are recieving your wordpress not found page then the problem is likely to do with your url rewriting. Wordpress uses a .htaccess file in the root folder of its install to redirect all urls to index.php so you can use urls how you like. It's likely that when you browse to the test folder it is redirecting that request to your index.php in your wordpress root. I would suggest you set up a test sub-domain instead of a test sub-folder. You are not the only person to face this problem I've seen others racking their heads over this very same problem.


Advertisement