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.

.htaccess and .htpasswd

Discussion in 'General Discussion' started by TacticalNuke, Jun 13, 2006.

  1. TacticalNuke

    TacticalNuke Registered

    Joined:
    Jun 13, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    So right now I'm running a VB site out of parent_html directory.

    .htaccess is located in this directory but is not preventing hotlinking. Where should I move it to do so?

    Secondly, I've heard that I should protect admin_cp with .htaccess and .htpasswd. So, from what I understand I put .htpasswd into my main directory (above parent_html) in the .htpasswd folder with the following code:

    wsabstract:y4E7Ep8e7EYV

    Now, I'll be using this converter thingamadoodle:

    http://www.desilva.biz/apache/pwdweb.html

    Anyway, since I'm protecting admin_cp I'll be putting the admin username and login there (NOT my cpanel login, correct?)

    From there, I'll put a .htaccess file where? And do I need another one, separate from my prevent hotlinking one.

    From what I know that .htaccess will have this code:

    AuthUserFile /usr/local/you/safedir/.htpasswd [this will change based on my directory]
    AuthGroupFile /dev/null
    AuthName EnterPassword
    AuthType Basic

    require user wsabstract [this will change based on username]

    Then, I'll also add this code:

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    to the .htaccess file.

    Alright, at that point then I should be good to go, correct?

    My main questions are these:

    Do I need two .htaccess files (one for hotlinking, one for the passwords)?
    Where do I put these .htaccess file(s) (one for hotlinking, one for pw protection on my admin_cp folder)?
    Does all my coding look correct?
    Should I also CHMOD the .htaccess for extra protection?
    The reason I might need 2 is because they may need to go in multiple places, but also if I CHMOD the hotlink one, then it may not work, but I'm not sure.

    Sorry for the long post, hope I can get this sorted out.

    Thanks!
     
Loading...

Share This Page