1

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.

abel
  • 137
  • 1
  • 8

3 Answers3

1

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.

Donald
  • 341
  • 2
  • 4
0
  • 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 ... }

MunsterNet
  • 454
  • 2
  • 3
0

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).

Kristaps
  • 2,925
  • 16
  • 22