• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

how to point any subdomain to main domain

DBaron

New Pleskian
Assuming I have setup on Plesk the virtual host "domain.com" (without specifying any subdomains)

I would like that any subdomain subxx.domain.com would point to the httpdocs of the virtual host "domain.com"

I am redirecting sub1.domain.com to the IP address of the server where there is Plesk
via the domain DNS (not part of Plesk)
but http://sub1.domain.com displays the default htdocs and not the "domain.com" httpdocs


how can I make sure that any subdomain subxx.domain.com points to the the domain.com httpdocs instead?


many thanks

Daniele
 
Last edited:
I am redirecting sub1.domain.com to the IP address of the server where there is Plesk
via the domain DNS (not part of Plesk)
but http://sub1.domain.com displays the default htdocs and not the "domain.com" httpdocs

That's because web server knows nothing about sub1. The right way will be to create a number of domain redirects to http://domain.com, i.e.
sub1.domain.com >> http://domain.com
sub2.domain.com >> http://domain.com

Alternatively you could make wildcard subdomain (*.domain.com) and point it to httpdocs, this is easier, but may negatively impact your site SEO.
 
That's because web server knows nothing about sub1. The right way will be to create a number of domain redirects to http://domain.com, i.e.
sub1.domain.com >> http://domain.com
sub2.domain.com >> http://domain.com

Alternatively you could make wildcard subdomain (*.domain.com) and point it to httpdocs, this is easier, but may negatively impact your site SEO.

Thanks Sergey!
can you please explain with a little more detail what you mean with:
1) creating a domain redirect (where should I do that?)
2) make a wildcard subdomain (*.domain.com) and point it to httpdocs (again, where should I do that?)

many thanks

Daniele
 
1) creating a domain redirect (where should I do that?)
Every domain has an option of being forwarding/redirect. Just choose right option when creating a domain.
2) make a wildcard subdomain (*.domain.com) and point it to httpdocs (again, where should I do that?)
You need to create new subdomain and put * in its name
 
Thanks Sergey!

I decided to choose the second option, as I am using these for webservices, not for webpages, so I am not interested in search engine indexing.

Daniele
 
Back
Top