This tutorial will show you how to enable password protection on subdomains within Plesk (tested on version 9.x). This is especially useful if you want one (or more) login for several different protected subdomains. These steps are necessary as Plesk doesn’t have a GUI feature to enable this.
Follow these steps:
- Create a new subdomain i.e, subdomain.yourdomain.com
- Create an empty folder in your main site’s root directory (not the subdomain), name it
- something relevant i.e, _subaccess
- In Plesk, under Protected Directories select Add Protected Directory
- Insert the same as your folder name from Step 2 i.e, _subaccess
- Click the _subaccess and create a user/s who will need access
- Within the subdomain public html root, create an .htaccess file and add the following:
AuthName " "
That’s it. You should now have password protection for any subdomain under yourdomain.com that you choose to to drop an .htaccess file into (as above).
Note: The location above, /pd/d..httpdocs, looks a bit funky, but that’s what it needs to read. httpdocs may be called something different on your server, like public_html etc.