8

I want to understand the architecture of web apps that use subdomains. I don't think that I'm phrasing this well, so let me explain.

Many web apps, like tumblr or shopify create a user's site on a subdomain. Say for example my tumblr account was johndoe then you could find my tumblr blog at johndoe.tumblr.com. Can someone explain how this is implemented?

gnat
20.5k29 gold badges117 silver badges308 bronze badges
asked May 29, 2013 at 17:59

2 Answers 2

12

Basically you could either set new CNAME record to your DNS server for each user (if you have such ability by your Hosting/DNS server provider) or use the Wildcard DNS record method and then use some rewrite rules to process the requests.

You can read more about it on this older post in stackoverflow.

answered May 29, 2013 at 18:09
1
  • 1
    Ahh, thank you! This is an awesome start. And the added vocabulary - wildcard subdomains - makes this a much easier topic to Google! Commented May 29, 2013 at 18:25
3

If you could't edit your DNS record, you can also insert a subdomain which will be pointing to *.yourdomain.com and it willl receive any subdomains, that way you will can check on your system if that subdomain inserted by the user is a valid domain, check on a whitelist array, os simply checking on the database if the user exists on the system.

answered May 29, 2013 at 18:36
1
  • That's the Wildcard DNS record method i mentioned earlier. Commented May 30, 2013 at 7:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.