Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I allow my customers to access subdomain.myapp.com from a subdomain.customerdomain.com. Google Apps allows you to do this with a CNAME change. How can I offer a similar functionality?

I found a duplicate question with no answers. I upvoted that question but since that was an old question I am asking this again.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

For the virtual hosts solution to work, you will still require a CNAME entry. Your DNS manager should allow you to enter a wildcard entry (where @ is yourdomain.com):

*.yourdomain.com => @

Otherwise, will will need to to enter your subdomain list manually:

a.yourdomain.com => @
b.yourdomain.com => @

Hopefully, your DNS is preconfigured with a wildcard, although probably not. If you cannot resolve your subdomain after setting up your virtual hosts, then you will know why.

If you post which server you're using (IIS, Apache, etc) more specific instructions could be given on setting up virtual hosts.

share|improve this answer
  • If you're using Apache, you can use the ServerAlias directive in your VirtualHost declaration

  • If you're using Lighttpd, you can use ModSimpleVhost and then create symlinks to your main folder, or use something like this :

    $HTTP["host"] =~ "^(hosta.example.org|hostb.example.net)$" { .. virtualhost configuration here ... }

share|improve this answer

1.You have some app, where customer each customer has custom subdomain - myuser.myapp.com.
2. You have dedicated server and / or root access. Just make your app default (catchall) virtual host and implement custom domain handling in app. Other way is adjust www server config each time client adds custom subdomain. Just make client point CNAME to your server DNS (like www.myapp.com).

share|improve this answer

Your Answer

 
discard

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.