• 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

Resolved how to configure my subdomains so that they do not use www?

Danny Fransen

New Pleskian
Hello,

i am new to the forum and plesk and need some help on how to configure my subdomains so that they do not use www. The issue is i have a wild card certificate, which does not support www.<subdomain>.<domain>.com and whenever i go to <subdomain>.<domain>.com it is automatically adding the www. So what i would like to have is that my primary domain can use www. but not my subdomains.

There is no possibility to set the "Preferred domain" on sub domain level and changing the primary domain to "<domain>.com" results in too many redirects when i try to access my site, but "<domain>.com" without www is not what i want anyway.

Any help will be really appreciated
 
You really ought to find out what is causing the redirect from <subdomain>.<domain>.com to www.<subdomain>.<domain>.com. This is not standard Plesk behavior and is likely configured trough your website.

Unless you've added your <subdomain>.<domain>.com as an actual domain in Plesk in stead of a sub domain.
 
Go to "Hosting Settings" of your main domain. Set Prefered domain to: none. That way Plesks doesn't do any redirects. Not for your main domain, nor for the subdomain.
If you go to www.maindomain.com , (as far as Plesk is concerned) you will get that. And if you go to maindomain.com you will get that as well.

Should you still have an active redirect - either www to non-www, or the other way round - see if there is an .htaccess based redirect for example. Or if it's a site based on a CMS if there is a plugin that's doing that.

Once you have no redirects at all working anymore, start with how you like it. Don't do it in Plesk as it can't do what you want. Use .htaccess (or nginx commands) to have your main domain redirect to www.maindomain,com , and leave the subdomain alone.

That should do it.
 
You really ought to find out what is causing the redirect from <subdomain>.<domain>.com to www.<subdomain>.<domain>.com. This is not standard Plesk behavior and is likely configured trough your website.

Unless you've added your <subdomain>.<domain>.com as an actual domain in Plesk in stead of a sub domain.
Thank you for pointing me in the right direction, issue is resolved now!
 
Go to "Hosting Settings" of your main domain. Set Prefered domain to: none. That way Plesks doesn't do any redirects. Not for your main domain, nor for the subdomain.
If you go to www.maindomain.com , (as far as Plesk is concerned) you will get that. And if you go to maindomain.com you will get that as well.

Should you still have an active redirect - either www to non-www, or the other way round - see if there is an .htaccess based redirect for example. Or if it's a site based on a CMS if there is a plugin that's doing that.

Once you have no redirects at all working anymore, start with how you like it. Don't do it in Plesk as it can't do what you want. Use .htaccess (or nginx commands) to have your main domain redirect to www.maindomain,com , and leave the subdomain alone.

That should do it.
Thank you for the step by step approach, was really helpful. There was a redirect in the .htaccess file that i removed.
 
Back
Top