Why use subdomains to designate tenants in a multi-tenant web application?

There are several ways to determine tenant on HTTP level: domain – tenant is determined by whole Host header sub-domain – sub-domain part of Host header, path based – path segment, usually by prefix host.com/tenantId/… cookie based – cookie value contains tenant id (good framework encrypts this!) user based – user session or some data … Read more

What are the allowed characters in a subdomain?

Letters (except stressed à), Numbers 0-9 and Hyphen. http://en.wikipedia.org/wiki/Domain_name excerpt: Valid characters that can be used in a domain name are: a-z 0-9 – but not as a starting or ending character . as a separator for the textual portions of a domain name From https://www.rfc-editor.org/rfc/rfc1035 Various objects and parameters in the DNS have size … Read more

Subdomain on different host [closed]

A sub domain is part of the domain, it’s like subletting a room of an apartment. A records has to be setup on the DNS for the domain e.g mydomain.example has IP 123.456.789.999 and hosted with Godaddy. Now to get the sub domain anothersite.mydomain.example of which the site is actually on another server then login … Read more

When should one use a ‘www’ subdomain?

There are a ton of good reasons to include it, the best of which is here: Yahoo Performance Best Practices Due to the dot rule with cookies, if you don’t have the ‘www.’ then you can’t set two-dot cookies or cross-subdomain cookies a la *.example.com. There are two pertinent impacts. First it means that any … Read more