Product:
Search Type:

[Info] How do I create wildcard subdomain?

Article ID: 2239 
Last Review: Jul,10 2008
APPLIES TO:
  • Plesk 8.x for Linux/Unix

SYMPTOMS

I have a few subdomains. But sometimes visitors are accessing non-existing subdomains. I wish to create one subdomain in order to catch all non existing subdomains for the domain.

RESOLUTION

Create a subdomain for the domain you wish with the name like 'zz-wildcard' in Plesk. This domain have to be the last in the subdomains' list ordered alphabetically, so we name it beginning from 'zz'.

Add special configuration (catchall for all subdomains) to the vhost.conf file of this subdomain, for example    /var/www/vhosts/domain.com/subdomains/zz-wildcard/conf/vhost.conf:
ServerAlias *.domain.com

Rebuild Apache configuration using websrvmng utility:
PRODUCT_ROOT_D/admin/sbin/websrvmng  -a -v

Now, requests to all non existing subdomains have to go to zz-wildcard.domain.com.


Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields