Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


is rendered by a page at - 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="" data-num-posts="2" data-width="500" }

I just opened a hosting account with 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)

share|improve this question

migrated from Aug 30 '12 at 15:17

This question came from our site for system and network administrators.

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 * name.

share|improve this answer

You must log in to answer this question.