Dynamic Subdomain help

Using a single web hosting account to host multiple sites

Dynamic Subdomain help

Postby ladrao2007 » Sun May 24, 2009 12:04 pm

I have searched around the forums for different topics on dynamic subdomains. I believe that I will need to add some sort of wild card in for the domain, but am not sure exactly what needs to be added to make this happen.

Here is the scenario of what I am trying to have happen. If you have used or seen Freshbooks, its the similar functionality for their login system.

I would like to be able to browse to http://businessname.mydomain.com and with using sessions and the system I have built, have that page show the same thing as if they were to go to http://www.mydomain.com/login.php?id=businessname using my .htaccess file now I have cleaned this url up to look like, http://www.mydomain.com/login/businessname. The PHP on that page gets that businessname, does a mysql query on the database to get the actual name of the company, and then when the user attempts to log in, it will query only the users in the database associated with that business.. I hope that wasn't too much rambling about how I am looking to have it function. But I basically would like it so that I could have http://businessname.mydomain.com and be able to pull the businessname part from the URL into the page to do the lookup for that business.

What would be the best way to set my .htaccess file up to enable me to be able to use these kind of subdomains?

Any suggestions would be greatly appreciated.

Thanks!

Travis
ladrao2007
 
Posts: 2
Joined: Wed Aug 20, 2008 8:04 pm

Postby richardk » Sun May 24, 2009 2:01 pm

Have you read FAQ: Virtual sub domains? Post any questions back here.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 24 guests

cron