OK not used this feature in siteworx but i created a sub domain, which added a dns entry as example:- my.domain.net cname domain.net
i understand that no a record is needed, now i can access either the subdomain or main domain by using http://my.domain.net or http://domain.net but when trying to access by using http://www.my.domain.net or http://www.domain.net it redirects to another totally different domain.
I do have 2 domains setup with separate siteworx accounts which use the same ip but not had this problem with using the http://www up until i added the sub domain so i am not sure whats changed.
Where would i look for a problem as it appears that domain with the subdomain is being redirected to my other domain.
Currently, the “www.” doesn’t automatically get added to subdomains. The problem has to do with the Rewrite rules we use for subdomains in the vhost conf file. You’ll need to make sure “www.sub.domain.com” is added in DNS and is resolving, then edit /etc/httpd/conf.d/domain.com.conf (where domain.com is your domain) and replace the text between “#subdomain logic” and “#end subdomain logic” with the following:
Again, domain.com should be replaced with your domain. Also, make sure that the #subdomain logic" and “#end subdomain logic” comments are still in there.
Edit: You’ll also need to make sure the “www.sub.domain.com” is listed as a ServerAlias directive.
Restart apache, and once the www.sub domain resolves, it should work.
i changed the code and added dns and www was resolving but on the sub domain still resolving to the wrong domain. www.sub.domain.net was resolving to www.domain.info my other totally different domain account.
checking /etc/httpd/conf.d/domain.net.conf
i noticed that this line was different to my other domain.com.conf
[SIZE=1]ServerAlias www.domain.bizftp.domain.biz mail.domain.biz[/SIZE]
[SIZE=1][/SIZE]
[SIZE=1]after adding the missing domain alias mail & ftp and www.sub.domain.net it all worked again with no redirection on the sub domain part.[/SIZE]
[SIZE=1][/SIZE]
[SIZE=1]was this correct or wrong ? [/SIZE]
[SIZE=1][/SIZE]
[SIZE=1]thank you for your reply[/SIZE]
[SIZE=1][/SIZE]
[SIZE=1]
[/SIZE]
[QUOTE=daveyw;11561]Now we must change every config if we will enable it. Is it possible that is works default when i use http://www.mysub.domain.com ?
If yes, how can i fix that :)[/QUOTE]
You can edit /home/interworx/etc/vhost-base.conf . It won’t help with existing domains though.
[quote=IWorx-Socheat;10543]Currently, the “www.” doesn’t automatically get added to subdomains…
Edit: You’ll also need to make sure the “www.sub.domain.com” is listed as a ServerAlias directive.
Restart apache, and once the www.sub domain resolves, it should work.
Socheat[/quote]
We’re trying to accomplish the same thing.
Apologies if this is an elementary question but when you mention “resolving” do you mean that we will have to wait for the same amount of time as when we were originally relocating the TLD?