www.webdeveloper.com
Results 1 to 3 of 3

Thread: Help with.htaccess/.htpasswd

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Help with.htaccess/.htpasswd

    Hi
    First post, so please be gentle!
    I am trying to set up limited access to a folder on my website, and have been playing with .htaccess and .htpasswd files. Now, I know that I have entered the correct path for the .htpasswd file as I get a password request up when I browse to the index file in the folder where the .htaccess file is stored. I then enter the username/password I added to the .htpasswd file, it accepts them, but the page displayed is blank, even though the content exists.
    My .htaccess code is:
    Code:
    AuthName "Website Admin"
    AuthUserFile /path/to/.htpasswd
    AuthType basic
    Require valid-user
    and my password file contains one login record.
    Am I missing something?
    I have removed the .htacces file and it works as expected, so it must be something to do with that but I don't know what else I need to do/add/change to get it working.
    Many thanks
    Martin
    Last edited by bsccwebmaster; 04-15-2009 at 02:47 PM.

  2. #2
    Join Date
    Sep 2004
    Posts
    398
    Now, I know that I have entered the correct path for the .htpasswd file as I get a password request up when I browse to the index file in the folder where the .htaccess file is stored. I then enter the username/password I added to the .htpasswd file, it accepts them, but the page displayed is blank, even though the content exists.
    Do you have an index file or are you expecting a directory index?
    What is your index file called?

    If you have an index file, try adding
    Code:
    DirectoryIndex yourindexfile
    or if you don't try adding
    Code:
    Options +Indexes
    Also try adding
    Code:
    # HTTP Error 401 - Unauthorized
    ErrorDocument 401 /
    (You could change / to a file for people who fail to login.)

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    I have published the files (it's a frameset, with an index file which loads the frameset together), and if I type the path to the index file in my browser, it asks for the password and then displays an blank page. I then deleted both .htaccess and .htpassword, and tried to open one of the images in one of the subfolders, but got an error indicating that there was a .htaccess in the subfolder, though it did not show up in the site browser via Dreamweaver. I then installed an FTP client and set that to show hidden files, and that did not show any .htaccess files either. I then tried to delete the remote files (including folders), but got an error when trying to delete the folder the images were in.
    Anyway, to cut a long story short - my plan was to create an protected area for specific people to be able to access photographs for download, but the site is running out of space and I am unable to progress this.
    Many thanks for your suggestions - if the space issue gets sorted, I will have a try of these and see what happens.
    Thanks again
    Martin

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles