Jump to content
xisto Community
Sign in to follow this  
Sharn

Path To /.htaccess Folder?

Recommended Posts

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/.htpasswd
AuthGroupFile /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

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. :blink:

Share this post


Link to post
Share on other sites

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. :blink:

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. :wacko:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.