Separate www subdomain

Sygmoral

Verified User
Joined
Aug 15, 2012
Messages
63
My example.com and www.example.com are separate websites. So far, I made that work by putting both of them in folders in public_html, and using .htaccess to direct the flow.

But now I need to use separate php versions for each, so I cannot keep them together anymore.

The problem is I do not manage to create a separate www subdomain. That is to say, I can create it, but it never shows up, because DirectAdmin puts the following very near the start:

ServerName www.example.com ServerAlias www.example.com example.com

Any subdomains I create appear below this, so they don't have any effect if www.example.com is mentioned there.

So what I "simply" want to do is remove the www.example.com from that root website config, and only keep example.com. I'm putting "simply" in quotes because I have not managed to do this in several hours, so that's why I'm here... ?

I did find "customizing httpd", but that sounds like taking over control for the complete httpd, whereas I only need to customize the VirtualHost section for this domain. I do have the option to make this a rule for all domains, and then just add ServerAlias www.example.com where needed, if that is easier to achieve. (I use this server only for my own domains.)

How to customize this domain name's VirtualHost (not by adding but removing a piece), or alternatively to change the template for all domains so that they no longer force-include www?
 
ut now I need to use separate php versions for each, so I cannot keep them together anymore.
Easy solution.
Remove the www A record from your domain.
Setup www.domain.com as a seperate domain entry under another account name if you want to use seperate php versions.

You say you can't because of the servername and server alias. With custom stuff that can be changed.
But it's logical because things like www, mail, server and smtp for example are never ment to be real subdomains. But you want to start using www like that.

It's very odd because www was just in the beginning used for world wide web, so it can be use with or without the domain. It's very uncommon practice to suddenly start using www.domain.com and just domain.com as totally different sites, which also works confusing for visitors also.

It's not a big issue to have all domains only use non-www with a default redirect, but what you want, 2 different sites... well.... I wonder why you even would want to makes no sense to me.

Templates can be changed via custom directory's too.
 
Back
Top