HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Password protected folder help (http://www.howtoforge.com/forums/showthread.php?t=43517)

kopite 17th February 2010 12:39

Password protected folder help
 
Hey everyone.

I have been trying to password protect a folder using .htaccess and .htpasswd file

.htaccess file as follows.

Code:

uthName .Admin Area.
AuthType Basic
AuthUserFile /var/www/###.co.uk/.htpasswd
require valid-user
php_flag register_globals 1


Everytime I try and access the folder however i get an error 500. I have edited the vhost file for the domain and set AllowOverride All. But this still happens.

Any idea?

till 17th February 2010 12:55

If you get an error in the browser, take a look in the error log of the website to find the reason for it.

In the first line of your .htaccess file is a typo, it must be:

AuthName "Admin Area"

and do not edit the vhost file manually as all manual edits will get removed automatically.

kopite 17th February 2010 13:01

Spelling mistake isnt in the proper .htaccess file and was due to bad copypasta :)

The rror logs show:

[Wed Feb 17 11:36:07 2010] [alert] [client 212.23.9.240] /var/www/####.co.uk/web/test/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only")

till 17th February 2010 13:13

Ok, then the error was what I posted above. Please change the line as I told you incl. the correct quotes.

kopite 17th February 2010 13:29

Doh I hadnt twigged on that the " had been changed to .

Feel like a complete idiot now :)

Thanks for the help till


All times are GMT +2. The time now is 09:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.