October 27, 201213 yr hi guys, having a little issue with password protecting a file with ht access my .htaccess file is stored in my main directory my .passwd file is stored above this in the root directory. when i enter the username and password it doesnt let me in... here is the code for the .htaccess AuthName "Restricted Area" AuthType Basic AuthUserFile ../.htpasswd AuthGroupFile /dev/null <Files blog_post.php> require valid-user </Files>
November 7, 201213 yr so .htpassword would upload to the directory above public_html folder and .htaccess file would look like: AuthName "Restricted Area" AuthType Basic AuthUserFile /home/username/.htpasswd AuthGroupFile /dev/null require valid-user This is based on a cpanel server but the basics are the same on any server. Just have to use the correct path.
November 22, 201213 yr Author It turns out that my code was correct. My host has disabled the use of HTaccess... urgh #drainer
November 22, 201213 yr Yeah, I spent about a month messing about with .HTaccess etc before my host finally worked out that they didn't have it turned on! After I contacted them several times about it!!
November 22, 201213 yr Author its an absolute nightmare, they want to charge me £15.00 for password protection services.
Create an account or sign in to comment