Dynamic sub-domain with php

software development

#1

I have a project that requires me to be able to create dynamic sub-domains.

What i mean by this is the user fills out a form on my site, gets approved etc and a sub-domain is automatically created for them.

Is this something that i can do with my dreamhost account?

Can anyone point me in the right direction of a php solution?

Thanks


#2

You can use PHP and MySQL to manage your subdomains. Subodmains are stored in MySQL. When people want to create, PHP is able to check whether the subdomain has been taken.

But I do not think we can automatically create subdomains. The only way to create subdomain is through DH panel.

Save [color=#CC0000]$97[/color] (max discount) on dreamhost plans by using promo code: [color=#CC0000]97CRAZY[/color].


#3

What about using an .htaccess file?

I came across this: http://blog.voodoochilli.com/2007/01/11/dynamic-sub-domains/

i’ll give it a try


#4

I very much doubt that will work here at DreamHost, as the sub-domains will not be configured in the DreamHost DNS system or in apache.conf, therefore an attempted access to one of your dynamic sub-domains will never get to your .htaccess file.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#5

There is not a way to do this with Dreamhost…So if your planning to offer a sourceforge type site or free web hosting, Dreamhost will not fill the bill.

Otherwise, you can setup your script to just create the user a directory and then allow them to upload to the directory such as.
http://www.yourdomain.com/joeuser

Really the only work around…Creating subdomains on the fly is not possible with DH’s setup.

Save [color=#CC0000]$97[/color] on Dreamhost plans by using promo code: [color=#CC0000]SRVR97[/color]