httpd.conf assumes 'www'

donco

Verified User
Joined
Feb 5, 2004
Messages
45
A customer hosts mydomain.net domain on personal servers (not on our DA servers).

customer creates community.mydomain.net for DA site
customer creates webhosting.mydomain.net for DA site pointer
(no respective www sub-domains created)

Our company creates community.mydomain.net DA site. Note that site is built with following httpd.conf (/usr/local/directadmin/data/users/user/httpd.conf):

ServerName www.community.mydomain.net
ServerAlias www.community.mydomain.net community.mydomain.net

NOTE: Incorrect ServerName (there is no www.community.mydomain.net), but site still works, because of ServerAlias which contains correct name.

Customer or us then creates webhosting.mydomain.net domain pointer. Note that domain pointer is configured with following httpd.conf (same location as above):

ServerName webhosting.mydomain.net
ServerAlias webhosting.mydomain.net www.webhosting.mydomain.net
Redirect / http://www.community.mydomain.net/

NOTE: Same issue, but theoretically works. Problem, however, is that Redirect redirects to non-existent www domain.

This is a bug--moral is that a www can always be added, while an assumed www cannot be unassumed. I checked config templates, and I do not see where this section of the user httpd.conf is written.

Comments? Thoughts? When can we expect a fix?

Thanks,
-the donco
 
Last edited:
Hello,

I can't really see that as a bug because www is added to all DA domains, thus should always work the way it was intented. End users are used to seeing www in front of a domain in their browsers, so the redirect has one. I'm assuming the reason it didn't work in your case was because he didn't add a www on his own server. I don't think I'll change it at this time, but what you can do, is copy the redirect virtualhost, and manually add it to your /etc/httpd/conf/httpd.conf file before the include line for the user in question. Then change your version however you wish.

There is no template for the redirect at this time (I could consider adding one, should there be interest).

John
 
Plesk presumes the domain exactly as entered and allows a checkbox for www.

Cobalt RaQ asks for hostname and domainname and creates the site with hostname.domainname.

I don't mind the way DA does it, and it certainly has always worked for us... but if I built a system from scratch I'd probably use the Plesk example.

Jeff
 
We're primarily dealing with 3rd level domains here. I don't know of many users who insist on placing 'www' in front of a 3rd level domain. How about 4th for that matter (www.my.domain.co.uk)? Where does the www end?

Note that if this was in a template, it would be a non-issue. :D

Further, it is poor practice to assume something like that. As I said, if I wanted www, I could easily add www after the fact, or even always via domain_create_post, but I hate having to work around code that is trying to "out smart me".

That's why I don't run Windows any longer. :p
 
You'd certainly want and possibly need to use it in a third level domain in the .uk domain tree.

After all, if you owned example.co.uk, you'd want your public to be able to type in www.example.co.uk, wouldn't you?

While DA creates all the links automatically, you can certainly take the entry for www out of DNS. You could even write a post-creation script to do it for you.

Jeff
 
Back
Top