Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Cambs, Uk
    Thanked 0 Times in 0 Posts

    .htacces problem

    Hi Everyone
    I have successfully set up a htaccess and htpasswd file to protect a members area of my website but . . .it password protects the whole site and not the set of pages i want it to.
    This is what i have as the .htaccess file:

    AuthType Basic
    AuthUserFile .htpasswd
    AuthName "Please enter your username and password"
    require valid-user

    and i have saved it into the folder where all the member pages are going to be.
    The other pages for the site are in the root directory, and the members pages are in a seperate folder in the root directory, and the htaccess and htpasswd files are in the members folder.
    What am i doing wrong/missed?
    It's the first time i've done this so please explain in simple terms, and i have read the htaccess posts in the forum and the link that goes to the htaccess explanation. I get how to do the files, it's just where to put them so that only the pages i want protecting are protected and not the whole site.
    I hope that made sense!
    Thank you

  2. #2
    Super Moderator
    Join Date
    May 2002
    Perth Australia
    Thanked 110 Times in 108 Posts
    save in the folder you want to protect (will protect sub-folders as well ) without the <directory> tags or use the full path to the directory !

    but just ...

    AuthType Basic
    AuthName "Please enter your username and password"
    AuthUserFile /home/user/full/path/to/.htpasswd
    require valid-user

    would be fine
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


Posting Permissions

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