Symptoms
I have a few subdomains. However, visitors are sometimes accessing nonexistent subdomains. I want to create one subdomain to catch all nonexistent subdomains for the domain.Resolution
For Parallels Plesk Panel 10.4 and later versions:
You may simply create a wildcard subdomain by entering "*" for its name:For Parallels Plesk Panel 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/domain.com/subdomains/zz-wildcard/conf/vhost.conf:
ServerAlias *.<YOUR_DOMAIN_NAME>Rebuild Apache configuration using the websrvmng:
PRODUCT_ROOT_D/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<YOUR_DOMAIN_NAME> or the httpdmng utility (for newer PP versions):
PRODUCT_ROOT_D/admin/bin/httpdmng --reconfigure-domain <YOUR_DOMAIN_NAME>Now, all nonexistent subdomain requests will to go to "zz-wildcard.domain.com."
Note: You need to replace <YOUR_DOMAIN_NAME> above with the actual domain name.