FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

.htaccess file

 


pashmina
how can it place this file in the directory to protect that particular directory?? and does this files works in other server than the apache server.

please some show me the programming for the .htaccess file and .htpassword file....
hexkid
pashmina wrote:
how can it place this file in the directory to protect that particular directory??


Suppose you want to protect the directory "/home/pashmina/domains/example.com/public_html/protected/" (which would be accessible at http://example.com/protected). Create this .htaccess in that directory
Code:
require valid-user
AuthType Basic
AuthName "Protected directory"
AuthUserFile /home/pashmina/domains/example.com/public_html/protected/.htpasswd


and your .htpasswd file just lists the valid users and their encrypted passwords, one by line
Code:
guest:eqLX5l2QKYIXM
admin:j5vP7y957hsQ2


The encryption method is (usually) different on Linux and Windows servers. For Linux use http://spectrum.troy.edu/password/ to generate the user:password lines automatically; or for both Linux and Windows user the htpasswd tool installed with the Apache server.
pashmina
it really helped me out...
thank you
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.