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:
http://jsmith.mysite.com
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?