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

0

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)

Sean Kean

Posted 2011-12-24T06:33:09.110

Reputation:

Answers

2

The most straightforward way of doing this is to use the DNS servers from your registrar resolve all queries to the IP address of your VPS.

On your VPS you should find that apache is running and it's configuration file is /etc/apache2/sites-enabled/000-default. This default setup will respond to all http requests for any *.example.com name.

user35787

Posted 2011-12-24T06:33:09.110

Reputation: