• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Another wildcard subdomain problem

S

SergheiH

Guest
Hi

I have 5 subdomains for my main domain.
The 3rd subdomain I've created to serve as a catch all subdomain.
Of course I've added in it's "vhost.conf" file the "ServerAlias *.domain.com" line and I read the KB from here: http://kb.odin.com/en/2239 .
But when I've added two more subdomains the catch all subdomain was catchig them also, even if my "catch all" subdomain name starts with last letter from alphabet "zz-wildcard".
This is happening because the rules in the "httpd.include" file are ordered by date of adding the subdomain and not alphabetical.

Can please someone suggest a solution for this?
Because right now I have only 2 options:
1. editing manually the "httpd.include" file each time I update some subdomain from Plesk, or
2. deleting the subdomain "zz-wildcard" and creating it again

Thanks
 
Last edited by a moderator:
Got it

Found the solution...

In the mean while my Plesk version was updated to 9.5.1 but I guess the same thing would work for any version.

But when I've added two more subdomains the catch all subdomain was catchig them also, even if my "catch all" subdomain name starts with last letter from alphabet "zz-wildcard".
This is happening because the rules in the "httpd.include" file are ordered by date of adding the subdomain and not alphabetical.

Well, the solution was simple: to edit Plesk's database "psa", table "subdomains".
I've checked if there is no connection between subdomain's IDs and other tables, and apparently there are no JOINs.
Then I've changed the ID of my "catch all" subdomain to be greater than other's. :)

Pretty simple...

Now my "zz-wildcard" subdomain's rules are the last in the "httpd.include" file and also the last in the list of subdomains displayed in Plesk and everything works perfect.
 
Back
Top