0

im using a gallery script in root directory that reads a subdirectory and lists images inside.

/gallery/index.php?gallery=aaa  --> lists thumbs in folder  /gallery/aaa/thumbs/
/gallery/index.php?gallery=bbb  --> lists thumbs in folder  /gallery/bbb/thumbs/

Click on thumb opens the large image. Large images are in folder

/gallery/aaa/   -> includes htaccess/htpasswd
/gallery/bbb/   -> includes htaccess/htpasswd

Ive added htaccess/htpasswd protection to each image folder to give 1 user access to 1 image folder. The problem is that the password prompt appears in a loop, multiple times. Would you help to setup the protection correctly? If this cant be done, whats a good alternative?

Thanks in advance

example for dir aaa:

htaccess file:
AuthUserFile /gallery/aaa/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>

htpasswd file:
admin:adpexzg3FUZAk
peter rea
  • 45
  • 7
  • Can you post the left several lines of your apache error logs, and access logs? Feel free to remove some information. – Justin E Apr 17 '14 at 21:04
  • Thx, i forgot to mention the thumb directory, the logs: "GET /gallery/aaa/thumbs/PICT0022.JPG HTTP/1.1" 401 401 admin [17/Apr/2014:23:17:00 +0200] "GET /gallery/aaa/thumbs/PICT0022.JPG HTTP/1.1" 401 401 admin [17/Apr/2014:23:17:07 +0200] "GET /gallery/aaa/thumbs/PICT0022.JPG HTTP/1.1" 401 401 [error] (2)Could not open password file: /gallery/aaa/.htpasswd, referer: http://peter.test.net/gallery/index.php?gallery=aaa [error] user admin not found: /gallery/aaa/thumbs/PICT0022.JPG, referer: http://peter.test.net/gallery/index.php?gallery=aaa – peter rea Apr 17 '14 at 21:30
  • 1
    Thanks Justin E, the logs helped. I did not use the full path. Problem is solved. – peter rea Apr 17 '14 at 22:45

0 Answers0