Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm having a SaaS site developed and will be offering white label service with some memberships. During user registration I will be asking users to enter a 'username' which will be used for a subdomain ie; 

If I begin creating subdomains after registration using the username they entred, what steps do I have to take to let a user white label their domain. I know they'll need to add a cname record to point a domain or subdomain to the subodmain on our server. But what other steps do I have to take on my end to make it all work?

share|improve this question
up vote 0 down vote accepted

I don't really get what you mean by 'white label' but I know a lot of sites who give out free subdomains do it like this

They create a directory for everyone who subscribes and make their webserver redirect all subdomains to folders in the root web site.

Example: -->

To make this work, you need to redirect all subdomains (wildcard * or @ depending on the DNS host) to the server. Finally you need to set up Apache like this:

RewriteCond %{HTTP_HOST} !^domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)
RewriteRule ^(.*) /%1/$1 [L]

If you wan't people to be able to use your service in their own DNS-environment, you need to add it as a vhost. Example:

  DocumentRoot /www/user
  ServerAlias *
share|improve this answer
Hi, what I meant was to allow members to user their own domain point it to, so they can login from With that rewrite condition do I have to setup virtual hosts for each subdomain pointing them to my root folder? – Anagio Nov 6 '11 at 9:48
Added it above. – Bart De Vos Nov 6 '11 at 9:59

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.