I am building a web application which will serve as a cms. Each user will get their own hosted "site". So typing in http://user1.myapp.com would display the content specific to user1. I think this will be possible by setting up a wildcard subdomain that would forward all subdomains to the main myapp.com site. If I am wrong about that, please correct me...

So, once the user has their "site" (their own subdomain), I would like to offer them the ability to create a new domain name, or transfer one they already own. So if you go to www.user1.com, the content that is displayed is actually http://user1.myapp.com, but the browser location doesn't change.

In order to provide the feature to register a domain, I will need to use a domain reseller api. I've looked at a couple sites and so far http://opensrs.com/ seems the most legit, plus their api documentation seems thorough, which is nice. Have you worked with anything like this before that you could recommend? I am basically trying to automate the process of setting up individual domains for each account. Note that I will not be managing payment for these domains. Each user will get a free domain (that will be paid for by me), so all I need to do is register new domains and associate them with the subdomain of their account (i.e. mask the subdomain with a new domain).

So now that you know the background...

  1. Is domain masking the appropriate term to describe what I am trying to achieve? Is there a better way to do what I am trying to do? Is there a legitimate way to achieve domain masking without using frames?
  2. Can I achieve domain masking while also using a domain reseller api?
  • As this question crosses the boundary between Server Fault and Stack Overflow it may be worthwhile cross-posting the question on SO, if you haven't already done so. Sep 14, 2009 at 21:56

2 Answers 2


To answer your question, this is all possible. It will take a lot of work to make it happen, but it is doable.

  1. I don't think 'Masking' is the correct word, you are probably thinking of domain forwarding or aliasing. You should almost never use iframes, use domain forwarding with a php or apache server variable to handle the sub-domain tracking.
  2. Apache can handle the wildcard domains in different ways. You can either set up a different directory for each wildcard domain or use .htaccess to create them on the fly. There are several questions about both on this site. You would need to do some programming in your cms to handle the subdomain and serve specific content that is dependent on which subdomain is being accessed. It is my opinion (maybe others would disagree) that this would be the best way to do this.
  3. It is all achievable via the domain reseller API - once the domain is set up it does not really matter to the registrar, it is all about how your software handles the domains and subdomains.

Looks like you have a lot of programming ahead of you!


I see that it's preety much about my problem here: Apache Rewrite to subdomain internally only

Difference is that I already done all the programing on CMS to handle such things, but I meet a problem with apache. How to leave user browser at www.user1.com while apache must point to your application with a request like user1.myapp.com...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .