- Plesk for Linux
- Plesk for Windows
How to set up password-protected directory in Plesk?
Note: In Plesk for Linux, the specified directory will be created if it does not exist.
In Plesk for Windows, you can only secure an existing directory.
1. Find which directory is the Document Root directory for the domain at Plesk > domains > example.com > Hosting Settings > Document Root :
or login to Plesk via SSH and run the following command in CLI:
# plesk bin subscription -i example.com | grep "WWW-Root" | cut -f 2 -d ' '
2. Navigate to Domains > example.com > Password-Protected Directories add the required directory that is located inside Document Root (relative path without
should be added):
In case it is needed to protect the whole website, specify "/" in the Directory name field.
3. To add a user to a password-protected directory:
- Go to Websites & Domains > Password-Protected Directories.
- Click the desired password-protected directory(for example /test), and then click Add a User.
- Type in the username and password, and click OK.
Note: in case non-zero value is specified for "Apache restart interval " under Tools & Settings - Apache web server, the configuration change will be applied with a delay.
Additional information can be found in Plesk Documentation