Question
How to set up a password-protected directory for a domain in Plesk?
Answer
- In Plesk, find which directory is the Document Root directory for the domain at Domains > example.com > Hosting Settings > Document root.
-
Additional step for Plesk on Windows Server (if you are on Linux, move to step 3):
Go to Domains > example.com > IIS Settings and make sure that Anonymous authentication is enabled:
-
Go to Domains > example.com > Password-Protected Directories and click Add Protected Directory.
-
Specify the directory, located inside Document Root from step 1 ('httpdocs' in this example), that should be secured. In this case, we are restricting an access to the /httpdocs/img folder (https://example.com/img). Click OK.
Note: Specify "/" to protect the whole website with a password authentication.
-
Now, click on the directory name.
-
Click Add a User to create a user that will be used to access the password protected directory. Click OK. Add other users if required.
-
Open the now protected URL in a web-browser (in this example, example.com/img) and log in using the username and password from step 6.
Note: If Apache restart interval is set at Tools & Settings > Apache Web Server, Apache must be restarted manually to apply the changes.
Additional Information
The command-line instructions are available at:
To learn more about password-protected directories, visit: