Forum Moderators: coopster

Message Too Old, No Replies

Creating SubDomains

         

Gian04

11:56 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



Is it possible to create subdomains programatically using PHP?

eelixduppy

3:42 am on Aug 15, 2007 (gmt 0)



Yes, you can. You just have to use mkdir() [php.net].

Gian04

4:04 am on Aug 15, 2007 (gmt 0)

10+ Year Member



Yes, but what I am referring to is a subdomain which can be access from http://subdomain.example.com NOT example.com/subdomain

[edited by: eelixduppy at 4:16 am (utc) on Aug. 15, 2007]
[edit reason] delinked [/edit]

eelixduppy

4:11 am on Aug 15, 2007 (gmt 0)



hehe, yes you are correct. This is what happens when I misread something ;)

Yes, it is possible, but I don't know the specifics. You'd have to edit .htaccess or the server config files because that is done with the server and not directly with php.

Sorry for the misunderstanding. I'm a little messed up from my recent long travels and its getting pretty late.

[edit]
You should still have to make the directory using the function above, and then change your config file to point the subdomain to that directory.

Habtom

5:02 am on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found that to be an interesting question. I haven't had a clue on how to do it through PHP, I checked a few sites, and one of them claims it is all about creating a folder under htdocs.

create new subdirectories in the /htdocs directory.
cd /htdocs

You can give it a try.

Keep me posted on this.