- 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.
- Find which directory is the Document Root directory for the domain at Plesk > domains > example.com > Hosting Settings > Document Root :
# plesk bin subscription -i example.com | grep "WWW-Root" | cut -f 2 -d ' '
Navigate to Domains > example.com > Password-Protected Directories add the required directory that is located inside Document Root (relative path without
httpdocsshould be added):
Note: Use just "/" directory to restrict access to the root of the site, i.e. to the whole site.
In case it is needed to protect the whole website, specify "/" in the Directory name field.
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