Questions tagged [subdomain]

Subdomain is a domain which is a part of a larger domain. For example, 'sub.example.com' is subdomain of 'example.com' domain.

subdomain
Filter by
Sorted by
Tagged with
735 votes
6 answers
601k views

Share cookies between subdomain and domain

I have two questions. I understand that if I specify the domain as .example.com (with the leading dot) in the cookie that all subdomains can share a cookie. Can subdomain.example.com access a cookie ...
adam0101's user avatar
  • 30k
283 votes
8 answers
632k views

How do I get a list of all subdomains of a domain? [closed]

I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option: dig @ns1.foo.example example.com axfr But this ...
cgicgi's user avatar
  • 2,949
282 votes
12 answers
205k views

Can (domain name) subdomains have an underscore "_" in it?

Can subdomains (domain names) have underscore _ in them?
Daniel Kivatinos's user avatar
266 votes
33 answers
469k views

"Could not get any response" response when using postman with subdomain

I am using postman to test an API I have, all is good when the request does not contain sub-domain, however when I add a sub-domain to URL I am getting this response. Could not get any response ...
Yahya Hussein's user avatar
176 votes
12 answers
151k views

How to let PHP to create subdomain automatically for each user?

How do I create subdomain like http://user.mywebsite.example? Do I have to access .htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-...
Skuta's user avatar
  • 5,852
175 votes
10 answers
73k views

When should one use a 'www' subdomain?

When browsing through the internet for the last few years, I'm seeing more and more pages getting rid of the 'www' subdomain. Are there any good reasons to use or not to use the 'www' subdomain?
Xn0vv3r's user avatar
  • 17.9k
160 votes
8 answers
193k views

Use localStorage across subdomains

I'm replacing cookies with localStorage on browsers that can support it (anyone but IE). The problem is site.example and www.site.example store their own separate localStorage objects. I believe www ...
JoJo's user avatar
  • 19.9k
129 votes
5 answers
182k views

How to put wildcard entry into /etc/hosts?

I recently wanted to point all subdomains for a test domain, let's say example.com to the localhost. Is there a way to point all requests on *.example.com to resolve to 127.0.0.1
aamir's user avatar
  • 3,913
126 votes
29 answers
171k views

PHP function to get the subdomain of a URL

Is there a function in PHP to get the name of the subdomain? In the following example I would like to get the "en" part of the URL: en.example.com
Damiano's user avatar
  • 1,269
126 votes
9 answers
69k views

Create subdomains on the fly with .htaccess (PHP)

I am looking to create a system which on signup will create a subdomain on my website for the users account area. e.g. johndoe.website.example I think it would be something to do with the .htaccess ...
Ben McRae's user avatar
  • 3,555
125 votes
3 answers
139k views

Subdomain on different host [closed]

I'm trying to host a subdomain for my site with a different hosting company and I'm running into issues on how to set it up. Here are the specifics: Domain is registered with GoDaddy. Nameservers are ...
mattsmith321's user avatar
  • 6,833
114 votes
18 answers
64k views

Get the subdomain from a URL

Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the first period then return whatever came after the "http://" ... Then you remember http://super.duper....
jb.'s user avatar
  • 10k
102 votes
4 answers
82k views

Should I delete the cgi-bin folder in a subdomain I just created?

Using cpanel on my hosting account, I created a subdomain - e.g. www.clothing.mysite.com A cgi-bin folder was automatically created in the directory for clothing.mysite.com. Do I need it? I'm only ...
Margo's user avatar
  • 1,023
94 votes
3 answers
43k views

Rails routing to handle multiple domains on single application

I've been unable to find a workable solution to this problem, despite several similar questions here and elsewhere. It seems likely that this question hasn't been answered for Rails 3, so here goes: ...
Aaron Vegh's user avatar
  • 5,237
90 votes
5 answers
84k views

What are the allowed characters in a subdomain?

What characters are you allowed to use in a subdomain? Example: for someSub.example.com the someSub portion. I know you can use letters, numbers, and hyphens, but what about other characters? Can _ ...
somerandomdude's user avatar
89 votes
9 answers
231k views

.htaccess rewrite subdomain to directory

Is it possible to use .htaccess to rewrite a sub domain to a directory? Example: http://sub.domain.example/ shows the content of http://domain.example/subdomains/sub/
Erik Djupvik's user avatar
  • 1,197
87 votes
6 answers
141k views

nginx - two subdomain configuration

I'm new to Nginx and I'm trying to get subdomains working. What I would like to do is take my domain (let's call it example.com) and add: sub1.example.com, sub2.example.com, and also have www....
ColLeslieHapHapablap's user avatar
86 votes
3 answers
133k views

Virtualhost For Wildcard Subdomain and Static Subdomain

I have an odd situation where I want to have the URLs app1.example.com, example.com and *.example.com all using a different virtual host. This is what I have (excluding example.com because it just ...
Dave's user avatar
  • 1,668
85 votes
3 answers
23k views

Multiple GitHub Pages and custom domains via DNS

I want to have one user page and multiple project pages hosted by GitHub Pages but available under ONE custom domain (with subdomains for each GitHub Pages repository, of course). So my goals are as ...
Florian Wolters's user avatar
82 votes
6 answers
47k views

Amazon S3: Static Web Sites: Custom Domain or Subdomain

Amazon.com just announced that one can host static web sites in a S3 bucket. I went to their setup page at http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteHosting.html and ...
Jay Godse's user avatar
  • 15.3k
82 votes
1 answer
131k views

Nginx subdomain configuration

I have nginx acting as a reverse proxy to apache. I now need to add a new subdomain that will serve files from another directory, but at the same time I want all location and proxy_pass directives ...
Thomas's user avatar
  • 4,671
80 votes
4 answers
149k views

How to set up subdomains on IIS 7

I have a website sitting on an IIS 7 server: WWW.example.COM I would like to create several sub domains that looks like SUBDOMAIN1.example.COM I created an IIS website and I set the bindings to be ...
Tal Cohen's user avatar
  • 1,053
80 votes
5 answers
81k views

HTML5 localStorage size limit for subdomains

HTML5's localStorage databases are usually size-limited — standard sizes are 5 or 10 MB per domain. Can these limits be circumvented by subdomains (e.g. example.com, hack1.example.com and hack2....
Chuck's user avatar
  • 236k
70 votes
4 answers
67k views

SSL Multilevel Subdomain Wildcard

I bought a wildcard certificate for *.example.com. Now, I have to secure *.subdomain.example.com. Is it possible to create a sub-certificate for my wildcard-certificate? If it is, how I can do this?
Attrachii's user avatar
  • 733
70 votes
4 answers
55k views

Should I use an A record or a CNAME for a wildcard subdomain?

Some people are saying use an A record and others a CNAME for a catch all subdomain. Which should I use and why?
Igor K's user avatar
  • 1,281
67 votes
6 answers
71k views

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

I am used to working on httpd ( Apache ) which provides a way to configure subdomains which is mapped to a directory. How can I do the same thing in Connect.js/Express.js ? I see that the only thing ...
Raks's user avatar
  • 1,743
65 votes
5 answers
29k views

What does Rails 3 session_store domain :all really do?

Updated question to make it more clear I understand that you can set the domain of your session_store to share sessions between subdomains like this: Rails.application.config.session_store :...
Nader's user avatar
  • 5,563
63 votes
4 answers
23k views

Rails rspec set subdomain

I am using rSpec for testing my application. In my application controller I have a method like so: def set_current_account @current_account ||= Account.find_by_subdomain(request.subdomains.first) ...
RailsSon's user avatar
  • 20.3k
63 votes
4 answers
69k views

Can HTML5 databases and localStorage be shared across subdomains?

I am attempting to share data across subdomains using Safari. I would like to use an HTML5 database (specifically localStorage as my data is nothing but key-value pairs). However, it seems as though ...
Sebastian Celis's user avatar
59 votes
2 answers
95k views

Wildcard subdomains with dnsmasq

I have a device that is already mapped to domain.tld. I now want to create a wildcard for all subdomains *.domain.tld so that they are mapped to the ip of domain.tld, too. How do I do this with ...
danb's user avatar
  • 593
55 votes
3 answers
93k views

Domain IP address for www and non-www for Canonical URL

To handle Canonical URL is it best practice to do a 301 redirect or better to have the same IP Address for both www and non www domain? For example: Canonical URL/domain wanted is http://example.com ...
Wasabi Developer's user avatar
55 votes
2 answers
17k views

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

Questions Why do some multi-tenant web applications use subdomains to designate the tenant while others do not? Are there technical, privacy, or security reasons? Is it dependent on the language or ...
Matthew Rankin's user avatar
54 votes
10 answers
17k views

subdomain vs. subdirectory in web programming

There are two main strategies for handling multiple "applications" on the web: subdomains (e.g. wiki.example.org, blog.example.org, admin.example.org, api.example.org/v1) subdirs (e.g. example.org/...
53 votes
17 answers
21k views

Public Wildcard Domain Name To Resolve To 127.0.0.1 [closed]

Is anyone aware of a public wildcard domain name that resolves to IP address 127.0.0.1. For example if I wanted to test a URL locally such as mywebsite.localhost.com or example.localhost.com but I ...
user avatar
51 votes
1 answer
20k views

Subdomain of website for Github pages project

I have a Github project, github.com/jeti/matrix, and I set up a "Github pages" site for the project so that it is accessible here jeti.github.io/matrix/. That is all configurable through Github. ...
bremen_matt's user avatar
  • 7,142
50 votes
1 answer
43k views

How do I get my computer's fully qualified domain name in Python?

I know I can use platform.node() to get my computer's network name: >>> import platform >>> platform.node() 'MyComputerName' But what I really want is something that will work ...
Jace Browning's user avatar
49 votes
2 answers
32k views

How do I make a custom subdomain on Firebase?

I have purchased a domain ("www.mydomain.com"). How do I make a subdomain on Firebase ("sub.mydomain.com"), if I am using Firebase hosting?
Doug Liu's user avatar
  • 491
46 votes
4 answers
48k views

How to test nginx subdomains on localhost

I want to test nginx subdomains before uploading config to the server. Can i test it on localhost? I try server { listen 80; server_name localhost; location / { proxy_pass ...
madhead's user avatar
  • 32.5k
45 votes
1 answer
33k views

Can subdomain.example.com set a cookie that can be read by example.com?

I simply cannot believe this is quite so hard to determine. Even having read the RFCs, it's not clear to me if a server at subdomain.example.com can set a cookie that can be read by example.com. ...
Christophe's user avatar
  • 2,062
42 votes
4 answers
19k views

Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?

Umm I'll try to be more clear.. In an application server I have written in node.js, I have inner-proxy for multiple ports: in my 8080 port I have my rest api. in my 3000 port I have my push server ...
Amit Evron's user avatar
40 votes
7 answers
148k views

Regular Expression - Extract subdomain & domain

I'm trying to form a regular expression (javascript/node.js) which will extract the sub-domain & domain part from any given URL. This is what I ended up with: [^(?:http:\/\/|www\.|https:\/\/)]([^\...
sunilkumarba's user avatar
40 votes
2 answers
25k views

Dynamic Subdomain Handling in a Web App (Flask) [closed]

I'm going to be using flask to create a web application, and part of the application will involve a subdomain (for example, user1.appname.org). I'm not sure how to go about creating these subdomains ...
Bruce Collie's user avatar
40 votes
7 answers
59k views

Why ww2 sub domains? [closed]

I have seen on the web some domain names having prefix of ww2 or ww3 or so (ww2.somedomain.example, ww3.yourdomain.example). And these happen mostly when traveling from a page to page. What would be ...
Nirmal's user avatar
  • 9,451
40 votes
3 answers
21k views

Does a session cookie on different subdomain count as 3rd-party?

Suppose I have a site at www.example.com which has an IFRAME pointing to ASP.NET site myapp.othersite.com - this causes issues with session and 3rd-party cookies which I understand. If I moved the ...
RossJ's user avatar
  • 575
37 votes
4 answers
9k views

How can I programmatically generate Heroku-like subdomain names?

We've all seen the interesting subdomains that you get automatically assigned when you deploy an app to Heroku with a bare "heroku create". Some examples: blazing-mist-4652, electric-night-4641, ...
dkulchenko's user avatar
37 votes
7 answers
44k views

Get the domain name of the subdomain Javascript

How i can get the domain name example.com from the set of possible subdomains sub1.example.com sub2.example.com sub3.example.com using javascript ...?
Aleksov's user avatar
  • 1,210
37 votes
9 answers
27k views

Javascript Redirect with Google Analytics

I need help figuring out how to successfully redirect while including Analytics code. I have a subdomain setup http://buuf.fractalsystems.org The subdomain is actually just a subfolder http://...
TryTryAgain's user avatar
  • 7,742
37 votes
6 answers
101k views

Domain doesn't work without `www`

When I type in my domain name like without the www (like http://example.com), it doesn't work and gives error message. However, when I add the www to it (like http://www.example.com), it works. Isn't ...
Digital site's user avatar
  • 4,427
36 votes
1 answer
47k views

Creating subdomains in Amazon EC2

How can I create subdomains on Amazon EC2? Is adding virtual host in httpd.conf is enough.. or any other changes also needs to be done? Thanks
Padmanabha Vn's user avatar
36 votes
1 answer
19k views

Nginx convert subdomain to path component without redirect

The idea is to take incoming requests to http://abc.example.com/... and rewrite them to http://example.com/abc/... That's easy enough to do with a 301/302 redirect: # rewrite via 301 Moved ...
accounted4's user avatar
  • 1,695

1
2 3 4 5
116