Protecting files on your site from unapproved clients can be significant. Much increasingly significant is the strategy by which you achieve this undertaking. You could utilize PHP to tune in for login approval data on each page, yet that doesn’t ensure your pictures, archives, and other media?
Servage gives you the option to .htaccess secure your websites with a few clicks only!
- login to servage control panel.
- click on Domain and Websites and Password Protection option.
- Select the domain name for which you want to enable password protection.
- On the right-hand side of the screen there is one green Add button.
- Then add title and click on folder in which you want to password protect it. After that, you have to set the username and password and click on the add button.
- What it will do is add that folder to password protected and when you access it will ask for username and password.
But what exactly it happens in the backend? How does password protection work? The Servage system generates two files the .htaccess file and .htpasswd file and includes automatically the respective code to secure your page.
This is the .htaccess file code:
AuthName “admin”
AuthUserFile /storage/content/xx/xxxxxxx/domain.com/public_html/admin/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
The above code protects a directory called “admin”. The “AuthUserFile” value is always specific to your hosting configuration.
The .htpasswd file containts this code.
admin:cnuHJXJQeSpYw
test:Glfi4dfg0j
The .htpasswd file contains the usernames and passwords of allowed users one per line. The passwords are MD5 encrypted for security purposes.
Hint: As soon as the .htaccess/.htpasswd files are created, you can adminstrate the protection via your Servage control panel. Just go to “Domain and Websites” -> “Password Protection”, select the domain name for which you want to adminstrate the protection and push the button “Edit”. You can now alter the title of the protection, add users to it and change the password.
If you should have questions related to this post or to any other Servage related subject, please contact us. We provide 24/7 real support via ticket (support@servage.net) or live chat on www.servage.net
No comments yet (leave a comment)