Instant Subdomain Creation

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
arbondurant
Forum Newbie
Posts: 1
Joined: Thu Oct 26, 2006 5:04 pm

Instant Subdomain Creation

Post by arbondurant »

Hi,

I have been working on a redirection website where users can shorten their url by making thier page a subdomain on my site. Ex. theirname.mysite.com.

This is where I got stuck - how can the user instantly create a subdomain. That's my main problem. If anyone knows about this, please let me know.

Here is what I have done so far:

http://www.surplusmagazineshop.com/redirection2

Username: demo
Password: demo

Again, any help on this would be appreciated

Aaron
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

i'm no expert in this but from what is see here you
can do without making a seperate domain.

just use the get command for this and put the target name in a table

create a table like this

target_site----ownname----passwd

and if people come in with a site name let the database check the name and
redirect them to the given site

hope it makes sense
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If you actually want to make a subdomain (that will actually resolve) you will need to be able to edit your servers configuration file and tell it what to do with the new subdomain. Usually folks would just leave it as a sub-directory and mock a subdomain using mod_rewrite though.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Everah wrote:If you actually want to make a subdomain (that will actually resolve) you will need to be able to edit your servers configuration file and tell it what to do with the new subdomain. Usually folks would just leave it as a sub-directory and mock a subdomain using mod_rewrite though.
Did You Mean The httpd.conf File or extra/httpd-vhosts.conf
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

It depends on your web server setup and how it handles subdomains/virtual hosts.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Everah wrote:It depends on your web server setup and how it handles subdomains/virtual hosts.
Sorry I Didn't Understand What You Told Would You Please Explain It
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

For a subdomain to work it needs to appear in the DNS (or at least a wildcard entry).
Post Reply