*.example.com wildcard domain can be parsed from a single page?

Posted by Sean Kean on Super User See other posts from Super User or by Sean Kean
Published on 2011-12-24T06:33:09Z Indexed on 2012/08/30 15:40 UTC
Read the original article Hit count: 274

Filed under:
|

For a domain 'example.com' - what is the easiest way to set up a wildcard dns (*.example.com), hosting, and htaccess/httpd.conf/virtualhost, and script on a page so that:

how.do.i.setup.a.site.with.wildcards.like.this.example.com

or

anything.that.is.given.as.a.subdomain.for.example.com

is rendered by a page at example.com/index.html - yet keeps the wildcard subdomain in the URL bar and passes the full URL as a parameter for rendering tags in HTML?

An example tag is a Facebook comment:

{ div class="fb-comments" data-href="http://how.do.i.setup.a.site.with.wildcards.like.this.example.com" data-num-posts="2" data-width="500" }

I just opened a hosting account with spry.com and have a VPS running Ubuntu 11.04-x86-LAMP -

Essentially, what is the most straightforward way of doing this? Thanks so much.

(I originally posted this over on stackoverflow but realize its more of a serverfault question)

© Super User or respective owner

Related posts about dns

Related posts about bind