Page 1 of 1
Any ideas for coding subdomains?
Posted: Sat Aug 27, 2005 2:06 pm
by ibizconsultants
Hello All,
I am about to develop a site with multiple domains....
e.g.
service1.domainname.com
service2.domainname.com
service3.domainname.com
As all my config files are common across the site, how do I code this.
Can any one help me with tips and ideas of how to go about doing this.
Thanks in advance.
iBizConsultants
Posted: Sat Aug 27, 2005 2:17 pm
by feyd
the actual server paths remain the same, so you can include the files fairly easily. The only things you have to consider are ones like cookies getting the right settings on the domain parameter, and links that are common. Commonly generated links (those generated by your core stuff) should be written to either use relative urls or $_SERVER['HTTP_HOST'].
Posted: Sat Aug 27, 2005 2:21 pm
by ibizconsultants
Thank you for your reply...
Do I have to arrange files under folders for different subdomains... i.e. should each subdomain have its individual folder.... ?
Do you have a tutorial explaining this?
Thanks
iBizConsultants
Posted: Sat Aug 27, 2005 2:27 pm
by feyd
that all depends on your hosting configuration. Most hosts I've run into (that allow subdomains) automatically generate a subdirectory of the main publichtml folder matching that subdomain name. This means that the subdomain content can be accessed via domain.com/subdomain and subdomain.domain.com. When I run subdomains, having common files, I store the common files in some central area and use an absolute path to that folder for the first inclusion. The scripts contained in there are able to figure out where they are, and how they are being accessed, so they change to whatever they need to for each instance of calling.
Posted: Sat Aug 27, 2005 2:41 pm
by ibizconsultants
Thank you for the prompt help....
I will get back to you if I have more questions....
Thanks again
iBizConsultants