logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: .htaccess
Author
pwlodarczak



Joined: 15 Feb 2008
Posts: 2

PostPosted: Fri 15 Feb '08 11:51    Post subject: .htaccess Reply with quote

Hi there,
I'm trying to password protect a directory. I have no access to the main apache 2 config files, so I created in my directory a .htaccess file that looks like this:

AuthUserFile /var/www/gallery.ahost.com/htdocs/mydir/gallery/.htpasswd
AuthName "Gallery"
AuthType Basic
Require valid-user

and a .htpasswd where I created a user. This works, but now I also get a login screen on the main page, when I enter

gallery.ahost.com

in my browser URL. I can say cancel and I get all access to the not protected directories but it is very annoying to the other users. How can I get a login screen just for my gallery directory?
Any help greatly appreciated.
Peter
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 15 Feb '08 18:10    Post subject: Reply with quote

try moving the .htaccess file into the /gallery folder itself.

Try reading said .ht files via
http://gallery.ahost.com/gallery/.htaccess
http://gallery.ahost.com/gallery/.htpasswd

If you cannot read the contents of the file, everything is good, but if you can read it's contents, then some server admin should be fired and you need to add to your htaccess file


<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>
Back to top
pwlodarczak



Joined: 15 Feb 2008
Posts: 2

PostPosted: Sat 16 Feb '08 11:38    Post subject: Reply with quote

The files are in /gallery and I cannot look at then through the browser, I get an access forbidden error.
The problem really is that now I don't only get a login screen when entering the /gallery directory but also when I go to the main screen:

http://gallery.host.com

Thank you
Peter
Back to top


Reply to topic   Topic: .htaccess View previous topic :: View next topic
Post new topic   Forum Index -> Apache