You can set a password on the required directory or file, by using following instructions. The user who requests this files or directories, will see 403 error. To enable password verification of files or directories on hosting, perform the following steps:
How to set a password on a directory
Step 1. Open .htaccess file
Step 2. Make the following changes:
<files config.php="">
AuthType Basic
AuthName «This directory is protected»
AuthUserFile /pub/home/.htpasswd
Require valid-user
</files>
To set password, you need to create .htaccess file and add login-password pair in user:password form.
To set password on a directory by control panel
Step 2. Go to Domains management and select the domain you need
Step 3. Select ‘Secure directories’ (‘File management’ → ‘Secure directories’).
Step 4. Go to ‘Manage users’.
Step 5. Enter user’s login and generate a password.
Step 6. Finish user creation and press ‘Add’.
Step 7. Go to ‘Manage access’ tab.
Step 8. Click ‘Add protected folder’ link.
- Step 9. Select the directory you need to set a password to.
Step 10. Specify the name for protected resource.
Step 11. Select ‘For access the folder both rules must be respected’.
Step 12. Keep default values.
Step 13. Specify the name of created user, for whom the rule should be observed.
Step 14. Finish creation by pressing ‘Add’ button.