The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

password

Discussion in 'General Discussion' started by welsh-wizard, Jan 5, 2003.

  1. welsh-wizard

    welsh-wizard Member

    Joined:
    Jan 2, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I am having great difficulty in finding out how to password certain pages on my website.

    Could someone please offer advice on how to do this in plain English for us newbies(ish) to have a go?

    Sorry to be a pain.

    Thanks.

    PS I don't want to password the ENTIRE site ! (just certain pages of it)
     
  2. iain-pczap.net

    iain-pczap.net Active Member

    Joined:
    Dec 27, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    to password protect some pages the most simple way is via .htacess

    open up notepad and paste in an edit of this
    &AuthType Basic
    AuthName &The description you want to appear&
    AuthUserFile /home/$username/.htpasswds/$dirname/passwd

    require valid-user
    &
    once thats in ur notepad you must name the file &.htaccess& and choose 'all files' from the file type.
    Be sure to include the &s in the filename.

    Then upload this into the directory you wish to protect.

    I'm not sure but you may be able to protect the main directory public_html by removing &$dirname/&.

    So basically the $username will be the username required to access cpanel, and $dirname would be the name of the directory you wish to protect.

    Obviously once u login for one protected file in a directory it keeps the login info until u close the browser so you can access more protected files without logging in again.

    Im unsure how to protect individual files using this method.

    Hope thats helpful.
     
  3. welsh-wizard

    welsh-wizard Member

    Joined:
    Jan 2, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    thanks for answering.

    Can you be a little more specific about what i need to replace with what

    eg.

    &AuthType Basic
    AuthName &The description you want to appear&
    AuthUserFile /home/$username/.htpasswds/$dirname/passwd

    require valid-user
    &

    (that means VERY little to me)

    replace &$username& with the username you want to use

    where does the &home& directory come from - I don't have one !

    If I have a directory called &Limited&
    and I only want a user called &Company&
    with the password &help&
    ...

    how would I create the .htaccess file?
     
Loading...

Share This Page