Server Fault is a question and answer site for system and network administrators. 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

I searched stackoverflow and google before posting this question.

I am developing a PHP/MySQL based dynamic conference website. Where users can register and create their own events for conference. Currently I have unique URL for each event and used .htaccess for that.

For example:


Now I want to change above implementations. Instead of using in URL I want to give users a feature where they can enter their own domain while using same code and database available on my server.

For example: should run

I am not looking for code examples, I need directions what are possible options, is it possible or not.

share|improve this question
up vote 1 down vote accepted

You're not trying to do anything too special, and it's definitely possible. The way in which this is generally achieved is as follows:

You configure a subdomain which is designed for receiving visitors redirected from an external domain. For example, The page on the end of this will look at the headers and query the database to decide where to redirect to. If a user attempt to access directly, the page should return a 404, another error or redirect to your home page.

The user configures their domain (or subdomain, whatever) with a new CNAME record of

And finally, to prevent account hijacking, your service will normally generate some kind of verification code which the user adds as a TXT record.

This is exactly how Google do it for Google Apps.

share|improve this answer
There is no automatic way to achieve this? Means any API, as normally my clients are not technical enough to configure their domains. – Irfan DANISH Jul 1 '13 at 10:05
Not really - you have no way of knowing what DNS service they're using and if it were possible, it would almost certainly be more complicated to set up their side than simply adding 2 DNS entries. – Dan Jul 1 '13 at 10:34
@IrfanDANISH Feel free to mark this as the answer ;) – Dan Jul 2 '13 at 11:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.