Share cookies between subdomain and domain

If you set a cookie like this: Set-Cookie: name=value then the cookie will only apply to the request domain, and will only be sent for requests to the exact same domain, not any other subdomains. (See What is a host only cookie?) Two different domains (e.g. and, or and can only … Read more

What are the allowed characters in a subdomain?

Letters (except stressed à), Numbers 0-9 and Hyphen. 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 Various objects and parameters in the DNS have size … Read more

SSL Multilevel Subdomain Wildcard

No, it is not possible. A wildcard inside a name only reflects a single label and the wildcard can only be leftmost. Thus *.* or www.* are not possible. And * will neither match nor, only But you can have multiple wildcard names inside the same certificate, that is you can have … Read more

PHP Getting Domain Name From Subdomain

Stackoverflow Question Archive: How to get domain name from url? Check if domain equals value? How do I get the base url? print get_domain(“”); // outputs ‘’ function get_domain($url) { $pieces = parse_url($url); $domain = isset($pieces[‘host’]) ? $pieces[‘host’] : ”; if (preg_match(‘/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i’, $domain, $regs)) { return $regs[‘domain’]; } return false; }

Rails routing to handle multiple domains on single application

It’s actually simpler in Rails 3, as per 1) define a custom constraint class in lib/domain_constraint.rb: class DomainConstraint def initialize(domain) @domains = [domain].flatten end def matches?(request) @domains.include? request.domain end end 2) use the class in your routes with the new block syntax constraints‘’) do root :to => ‘mydomain#index’ end root :to => ‘main#index’ … Read more

HTML5 localStorage size limit for subdomains

From A mostly arbitrary limit of five megabytes per origin is recommended. Implementation feedback is welcome and will be used to update this suggestion in the future. It also mentions that : User agents should guard against sites storing data under the origins other affiliated sites, e.g. storing up to the limit in, … Read more

Virtualhost For Wildcard Subdomain and Static Subdomain

<VirtualHost *:80> DocumentRoot /var/www/app1 ServerName </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/example ServerName </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/wildcard ServerName ServerAlias * </VirtualHost> Should work. The first entry will become the default if you don’t get an explicit match. So if you had point to it, it would be caught be

How can I configure multiple sub domains in Express.js or Connect.js

Or alternatively you could use vhost. Then, create several sites in their own directory and export the express app, eg. /path/to/m/index.js: var app = express() /* whatever configuration code */ = app // There is no need for .listen() And then handle all requests with the following app: var vhost = require(‘vhost’); express() .use(vhost(‘’, … Read more