We help IT Professionals succeed at work.

.htaccess

hulken
hulken asked
on
Medium Priority
169 Views
Last Modified: 2010-03-04
Say that I want to set so only user nusse with password test can acess the http://www.test.com/

(the dir /home/httpd/html)

how can I set this up with .htacess ?

What files need to be created. wherew should I put them and how should they look?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
<Files .htaccess>
    deny from all
</Files>
<Files .htpasswd>
    deny from all
</Files>
AuthName        your-string-here
AuthType        Basic
AuthUserFile    /home/httpd/html/.htpasswd
# keep in mind that this file should better be in a directory *not public accessable*
AuthGroupFile   /dev/null
<Limit GET POST>
    Require      valid-user
</LIMIT>

Author

Commented:
This is the .htaccess file?
CERTIFIED EXPERT

Commented:
yes

with "this file" in previous comment I meant the htpasswd

Author

Commented:
I mean the text you wrote abowe is the .htacess file? that I put in the /home/httpd/html
CERTIFIED EXPERT
Commented:
yes, complete text of my 1'st comment

Explore More ContentExplore courses, solutions, and other research materials related to this topic.