Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and using subdomains

Status
Not open for further replies.

mike2277

Programmer
Mar 25, 2002
54
0
0
US
Hi all,

I've seen many web applications being built now that create a subdomain on the fly when the user creates their account. I'd like to figure out how to do this and how to point the subdomain to the proper database record.

For example, Joe Smith creates an account using an online form. A subdomain would be created dynamically using the username he selected:
Next, when a user enters that url (jsmith.mysite.com) in the browser, I need to be able to direct him to the proper homepage (my CF page would need to pick off the "jsmith" in the url). Is there a way to do that? (hundreds of users would be sharing the same index.cfm page but the look would be different depending on their username)

I have seen companies with server software like Plesk that allow me to create a subdomain dynamically using an API but I'm not quite sure how that would work.

Another solution that came to mind was to change the DNS with my hosting provider to wildcard A mysite.com so it would something like * A 111.222.333.444 (only slightly familiar with this)

That way, with a wild card, anything in front of mysite.com would be directed to my CF index page. On that page I guess I'd need some sort of sniffer to be able to read the username that's in front of mysite.com.

Any ideas?
 
By the way, I'm using Windows Server 2003, ColdFusion MX 7 and SQL Server.

I run my own server but my domain resides with my ISP.
 
the sniffer that you're thinking about is to examine the CGI.SERVER_NAME variable which is present on every page

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top