- Plesk 12.5 for Linux
- Plesk 12.0 for Linux
How to create one subdomain to catch all non-existent subdomains for a domain?
Note: The below solutions are for Linux only and will not work on Windows, because IIS does not support wildcard host headers.
For Plesk 10.4 and later versions:
Create a wildcard subdomain by entering "\*" for its name:
For Plesk 10.3 and earlier versions:
Create a subdomain for the domain in Plesk with a name like "zz-wildcard." It has to be the last in the subdomain list, which is ordered alphabetically, so start its name with "zz."
Add special configuration (catch-all for all subdomains) to the "vhost.conf" file of this subdomain, e.g., /var/www/vhosts/example.com/subdomains/zz-wildcard/conf/vhost.conf:
Rebuild Apache configuration using
# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<YOUR_DOMAIN_NAME>
# /usr/local/psa/admin/bin/httpdmng --reconfigure-domain <YOUR_DOMAIN_NAME>
Now, all nonexistent subdomain requests will to go to "zz-wildcard.example.com."
Note: it is needed to replace <YOUR\_DOMAIN\_NAME> above with the actual domain name.