I want to have subdomain created for each member like username.domain.com upon registration. Something like what happens with blogspot (blogger). Is it subdomain or just redirect in .htaccess? How to do this? Thanks dshah
This feature requires that wildcard domains are enabled for our domain so that *.domain.com is resolved to the same IP address, and to the same directory that your main domain points to. or in other words, there is no need to create the subdomains before they are used because when using wildcard subdomains, all possible host names will be resolved to the same address (and directory!) You need to configure Apache using wildcard domains, check this 2 excellent articles for same here: http://steinsoft.net/index.php?site=Programming/Articles/apachewildcarddomain http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/
Let's assume you already have the wildcard DNS working, here is a mod_rewrite example to capture the subdomain and use it realistically in the program. In the above example, the first line sets the subdomain into %1 which can then be used in the second line. That means that: http://me.yourdomain.com Would automatically get converted to: http://www.youdomain.com/program.php?user=me There are other ways to accomplish this as well. You would have environment variables which have the host name me.yourdomain.com in them. You could use PHP to split on the period and take the first value coming out and set that as the username. That would allow you to do it internal to the script and WITHOUT the need for mod_rewrite. Hope this helps.
Domain configuration is aprox like a parking domain system. If you have access at console and some basic skills about ISC DNS (bind9 http://www.isc.org) you can do the "wilcard domain " reading this: http://www.webmasterstalks.com/index.php?page=10 . Just get the example for 1 domain not for more Regards