title: how to restrict access to directory so I can run php scripts from browser
body: <p>First post, be gentle :) ... I have been doing searches on this site as well as others and realize I may be in over my head.</p>
  
  <p>Here is the situation:</p>
  
  <p>1) I have a website running on BlueHost (linux OS, I think is running Apache) that is open for general access</p>
  
  <p>2) I have a set of php scripts on the website that I would like to limit the access to only one user via some sort of login through a webbrowser.</p>
  
  <p>3) I have put the scripts in a directory under /home/public_html.  I did not know how to access the files with a web browser above that level (like in /home)</p>
  
  <p>4) These scripts do not access any other part of the website nor does any other part of the website access the scripts.</p>
  
  <p>Here is what I tried:</p>
  
  <p>1) Using cpanel to change the permissions on the directory. Result was a 404 when I try to access the scripts with a browser.</p>
  
  <p>2) .htaccess/.htpasswd for the folder in question (found some instructions here and on the web).  Didn't seem to force asking for a password so I probably did something wrong</p>
  
  <p>I know this is vague but I will ask it anyway...  Given my situation, is there a preferred approach I can research?  For example, having the php code ask the user for a password, somehow accessing the scripts from the server side, etc.</p>
  
  <p>Thanks for your patience and help</p>