FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
.htaccess tutorial
CANT UPLOAD .htaccess, .htpasswd, .header, .footer
.htaccess IP Blocking
Custom error pages using .htaccess
htaccess
.htaccess problem
protecting a file with htaccess
.htaccess and FTP
htaccess
Forbidden message after upload .htaccess file
.htaccess file rename
Need a .htaccess file to process ssi AND allow scripts
Limiting php file functions with .htaccess
Htaccess file in Filezilla
Reply to topic    Frihost Forum Index -> Scripting -> Others

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