making use of subdomains
Posted: Mon Nov 17, 2003 7:29 am
Hopefully I'm in the right area for this,
I have built a blogg-style site for some friends and myself using PHP and MySQL. I want to use subdomain so that each user has a unique URL i.e
user1.website.com
user2.website.com
the problem is I'm having trouble working out a way to direct the subdomains to the main set of php files, to activate a subdomain I make a folder in the FTP root called user1.website.com and place whatever files I would like in there.
at the moment I have placed a copy of the php files in each folder and I get the subdomain to tell the code who's site it is, but obviously this is bulky and it means if I want to make a change I have to update the page in every folder.
I have thought of using includes, but this still reqires a file for each include, I have also tried to use frames but I can't access the subdomain name from a page stored 'outside' the subdomain.
sorry if it's a bit scattered, I think it's an interesting topic on backend site design and also hopefully a solution for my needs.
thanks for any ideas
I have built a blogg-style site for some friends and myself using PHP and MySQL. I want to use subdomain so that each user has a unique URL i.e
user1.website.com
user2.website.com
the problem is I'm having trouble working out a way to direct the subdomains to the main set of php files, to activate a subdomain I make a folder in the FTP root called user1.website.com and place whatever files I would like in there.
at the moment I have placed a copy of the php files in each folder and I get the subdomain to tell the code who's site it is, but obviously this is bulky and it means if I want to make a change I have to update the page in every folder.
I have thought of using includes, but this still reqires a file for each include, I have also tried to use frames but I can't access the subdomain name from a page stored 'outside' the subdomain.
sorry if it's a bit scattered, I think it's an interesting topic on backend site design and also hopefully a solution for my needs.
thanks for any ideas