Could we help you? Please click the banners. We are young and desperately need the money
In case that you want to use htaccess authorisation on the website, you should need two files:
In your .htpasswd file you would need to write your username and password, which looks something like this:
Somename:$apr1$8i60/hzd$J8U/qjNYHHASwkcDA29pq0 Someothername:$meh1$8i60/hzd$J8U/qjNYHHASwkcDA29ss1
Each line contains a username and a password separated by a colon ":". Passwords are encripted and in order to create them you can use some online tool for that or create it yourself with few lines of PHP code:
<?php $myPassword = 'some awesome password'; $encripted_password = crypt($myPassword , base64_encode($myPassword )); ?>
Your .htaccess file will contain the following code:
AuthType Basic AuthName "restricted area" AuthUserFile /path/to/your/password_file/.htpasswd Require valid-user
Now your authorisation works. But if you want to allow direct access to your website based on the IP address: code in the .htaccess file should look like this:
AuthType Basic AuthName "restricted area" AuthUserFile /path/to/your/password_file/.htpasswd <RequireAny> Require ip 111.222.333.444 Require valid-user </RequireAny>
where 111.222.333.444 is the IP address which will be excluded from authorisation.