Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess and .htpasswd

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

  1. TacticalNuke

    TacticalNuke Registered

    Jun 13, 2006
    Likes Received:
    Trophy Points:
    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:


    Now, I'll be using this converter thingamadoodle:

    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

    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.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice