• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

wildcard subdomains of alias domains

Martin_Sauer

Regular Pleskian
System: Plesk Panel 12, updated on CentOS 6

Situation:
"Main-domain" domain with 2 "alias-domains" (301-forward). For "Main-domain" I created a wildcard subdomain. All works fine.

ToDo:
I want to create wildcard domains for both "alias-domains".

Problem:
It is not possible to create wildcard subdomains for both "alias-domains".

---------------------------------
Questions
1. Any idea on how to create wildcard-subdomains on "alias-domains"?
2. How do I disable Plesk to respond to every domain, which isnt covered by a wildcard?
 
I have exactly the same problem. I think this is an oversight in the way plesk creates the virtual host files using /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php and /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php

Plesk already makes sure that all normal subdomains also work for alias domains, so if there is a wildcard subdomain for the main domain, it makes sense that there should be wildcard subdomains for all the alias domains too. I think it would be a very simple change to support this, so let's ask Parallels...

Dear Parallels,

could you please extend the code in /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php and /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php so that wildcard subdomains also work for alias domains when the main domain has a wildcard subdomain. For example something like the following addition at line 26 of /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php for the apache part.

<?php foreach ($VAR->domain->webAliases AS $alias): ?>
ServerAlias "<?php echo $alias->asciiName ?>"
ServerAlias "www.<?php echo $alias->asciiName ?>"

If <?php if ($VAR->domain->isWildcard): ?>
ServerAlias "*.<?php echo $alias->asciiName ?>"


<?php if ($OPT['ipAddress']->isIpV6()): ?>
ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
<?php else: ?>
ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
<?php endif; ?>
<?php endforeach; ?>

Thanks
 
Hi CPJ,

please use your very own CUSTOM templates, if you think that additional settings should be made. The standard Plesk templates work very well on thousands of servers with Plesk and so there is no need for Parallels to change them.

Changing Virtual Hosts Settings Using Configuration Templates ( Plesk 12 online documentation )
 
Thanks UFHH01 but I don't agree...

Plesk supports wildcard subdomains
Plesk supports alias domains
Plesk currently DOES NOT support wildcard subdomains on alias domains

This makes no sense and it would be trivial for Parallels to add this as an optional feature.

Hi again Parallels,

what do YOU think about adding this optional feature ?
 
Trivial as it may be to add this as a feature, if 99% of Plesk installs won't make use of it (or if it potentially unnecessary complexity to the average Plesk administrator's ability to manage DNS since it could confuse the average Plesk administrator who may not possess your understanding of what this or why it's there), the Plesk custom template structure is designed for exactly what you might be looking to do.

If you can get Parallels to add this to their product road map as part of the actual template, kudos to you!
 
I'm all for simplicity but what is implemented right now is not logical.

For example, assume you have the following Plesk settings for mydomain.com:

mydomain.com -> httpdocs
sub.mydomain.com -> subdomains/sub
*.mydomain.com -> subdomains/catchall
myotherdomain.com = alias for mydomain.com
Then if you browse to the following URLS, you get the following results:

http://mydomain.com -> opens httpdocs/index.html
http://sub.mydomain.com -> opens subdomains/sub/index.html
http://foo.mydomain.com -> opens subdomains/catchall/index.html​

And for the aliased domain, the following work as expected

http://myotherdomain.com -> opens httpdocs/index.html
http://sub.myotherdomain.com -> opens subdomains/sub/index.html
BUT...

http://foo.myotherdomain.com -> 404 Not Found !
Parallels have gone to the trouble of making sure all the normal subdomains of the main domain are accessible from the alias domains. Logically, this should mean that the wildcard catchall subdomain is also accessible from the alias domains.
 
Back
Top