Hi all, I would truly appreciate if someone could point me in the right direction about the following. I have a domain with 150 subdomains. THey are all working well. Lets call them: sudomain1.domain.com sudomain2.domain.com sudomain3.domain.com sudomain4.domain.com sudomain5.domain.com I would like to do the following in one of the subdomains, for example, subdomain3.domain.com I would like to display what is currently under that subdomain as a different domain... that is, display what i have hosted in subdomain3.domain.com now, with new domain: newdomain.com I have already pointed newdomain.com to the IP that hold this subdomain, but now i do not know how to direct the person that types such url to the specific new subdomain, that is, show the content of subdomain3.domain.com when someone types newsubdomain.com. I have the website with a Plesk Panel. Is this something i need to do within Plesk (Version 9.5.4)? or may i do it in another way through code? Your help pointing me in the right direction would be deeply appreciated. Thanks!
Thanks Cybercon, but not sure if i understood you correctly. Basically newdomain.com is already pointed to the server (through the domain registrar).. the only pending thing is that the server that holds the subdomains (to which nwdomain.com is pointing) needs to know to which one of the subdomains (of the 150 I have) it should redirect "newdomain.com".... I understand this is something that should be done at the server level that holds the subdomains... If what you mean is use cname in DNS at domain registrar, that has already been done. If you mean something else, please explain further so I can understand better what you mean. Thanks!
Midi, In order for the domain you wish to use to display the respective sub-domain to actually show up, it will need to be added to the sub-domain's virtualhost configuration, for example: <VirtualHost IP:80> ServerName subdomain1.domain.com ServerAlias newdomain.com </VirtualHost>
Zacharooni`s answer is best solution I think. But , may be better this will as in apache docs. <VirtualHost IP:80> ServerName newdomain.com ServerAlias subdomain1.domain.com ServerAlias subdomain2.domain.com ServerAlias subdomain3.domain.com </VirtualHost> Please sorry if I made a mistake.
Thanks a lot Zacharooni for your help in this. Thanks Zybermichail por your input and confirmation... but you posted this & changed the order of serverName & serverAlias from what Zacharooni changed. Do you think this is the correct order?
Technically, they would both do the same thing, however if the Apache configuration is managed by means of a hosting panel like cPanel, then the changes will revert themselves upon the next rebuild. If you do run cPanel, then you can do what's called Parking a domain, which essentially inserts the ServerAlias into the rebuilt configuration, which takes care of the folder and domain mapping.
Thanks again Zacharonni! If we do it the way you have mentioned, will the server have any side effects in case we have more than 1000 sub domains that are redirected to different domains? Currently we run around 160 subdomains and use Drupal that automatically does the mapping of subdomains. We are looking forward to move to a custom based solution in php and want our solution to be as scalable as it is currently in terms of creating subdomains. Please let me know.
midi, Not a problem. Other than taking Apache slightly longer to restart, because of the number of subdomains. If Drupal automatically handles the subdomain creation, why don't you just use a wildcard subdomain, that is to say, park *.yourdomain.com to a specific folder, point * A record to the IP of your website, and essentially anything.yourdomain.com will point to that folder on that IP, while Drupal handles the subdomain redirection.