• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

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