Sharn 0 Report post Posted November 15, 2006 Well - I'm trying to set up .htaccess for a password to a file on my site, but I can't login with the user and pass I gave. I think it's cause I don't have the whole directory. I'm using this site:http://forums.xisto.com/no_longer_exists/This is my .htaccess:AuthName "Restricted Area" AuthType Basic AuthUserFile /.htpasswds/.htpasswdAuthGroupFile /dev/null <Files submit.php>require valid-user</Files>I noticed the htpasswds directory when I was looking around. I expect that is what it's for, right? Anyhow, does anyone know the path I need to use this? Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted November 16, 2006 From your cpanel, perform a phpinfo and the _SERVER["DOCUMENT_ROOT"] should show up under the php variables down near the bottom of the page. Mine is : "/home/jlhaslip/public_html" "jlhaslip" is my cpanel user-name, so I assume the root folder of my account is "/home/jlhaslip" and that is where I think the .htaccess file belongs for what you want to do. The path to the file you want to protect will depend on exactly where is resides in the file system for your account. If you can tell where it is relative to the public_html, then you should be able to combine the info above with the known path to the file. Share this post Link to post Share on other sites
Sharn 0 Report post Posted November 16, 2006 From your cpanel, perform a phpinfo and the _SERVER["DOCUMENT_ROOT"] should show up under the php variables down near the bottom of the page. Mine is : "/home/jlhaslip/public_html" "jlhaslip" is my cpanel user-name, so I assume the root folder of my account is "/home/jlhaslip" and that is where I think the .htaccess file belongs for what you want to do. The path to the file you want to protect will depend on exactly where is resides in the file system for your account. If you can tell where it is relative to the public_html, then you should be able to combine the info above with the known path to the file. Ahhhh, yes. EXACTLY what I was looking for. Thanks a whole lot, Haslip. I need to post a big reminder somewhere that says PHPINFO. Rofl. Share this post Link to post Share on other sites