how to direct a subdomain to a sql data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

how to direct a subdomain to a sql data

Post by adsegzy »

Hello friends,

I have a membership site where members will submit their data and choose a template to display their information. On this site, I want each member to have his own subdomain (eg membername.mysite.com) whereby anybody that enter the subdomain into the address bar will be directed to the template the person has chosen and the member's data will be collected from the database and displayed. A very good example is how articles that are summited are being view on WWW.BLOGSPOT.COM (eg myblog.blogspot.com)

Regards
adsegzy
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to direct a subdomain to a sql data

Post by requinix »

1. Don't set up an actual subdomain for each member. Use a wildcard instead: *.example.com.
2. If it's http://www.example.com, display your site. Even if you don't enforce the www subdomain now it's still a good idea - separates the "your site" from the "everything else".

Question: is there only one page to display, or do they (in effect) have an entire site?
Post Reply