Originally Posted by Skiilz
It only protect the directory and there is a index.php there.
index.php is the admin dashboard. When I type admindirectory/index.php it wont protect the access to this page.
Thats why I'm trying to use the .htaccess and .htpasswd.
If you had tried what sizzlefire
recommended you would have found that the .htaccess
files are created for you in the directory selected for protection and they do not need further manipulation/alteration. Staying with your example: if you follow the lead given and somebody then tried to access the file ../admindirectory/index.php
(or more precisely *any* file in admindirectory
) a prompt for login and password would appear.
If you *did* follow it correctly so far and it still appears to you that there is no protection present, then you should note that once given the login is of course valid until the connection/session refreshes/expires. So if you want to check it out you have to refresh or completely close and restart your browser before trying to access the page again (whatever is needed depending on your browser and security settings).
... thank you for choosing 000webhost.com!