Subdomain is a domain which is a part of a larger domain. For example, 'sub.example.com' is subdomain of 'example.com' domain.
Questions tagged [subdomain]
5761 questions
37
votes
4 answers
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, morning-frost-5543, radiant-river-7322, and so on.
It…

dkulchenko
- 640
- 7
- 12
37
votes
7 answers
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
- 1,200
- 5
- 17
- 27
37
votes
6 answers
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 it supposed to work both ways (with and without…

Digital site
- 4,431
- 12
- 48
- 72
36
votes
2 answers
In a django web application, how do you give users their own subdomain?
I'm starting a new web app project using Django and Pinax. I want to be able to give my users unique domain names like Wordpress and other sites do : username.wordpress.com. I'm not sure how to approach this with Django, since the url parsing logic…

Chris Lawlor
- 47,306
- 11
- 48
- 68
36
votes
1 answer
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
- 624
- 1
- 14
- 33
35
votes
4 answers
Free DNS server for Windows XP/Vista/Win7?
I'm currently developing a security solution that should work across domains and as such I need a small private dns server to add various entries to. I could alter the hosts file to achieve the same result but since the hosts file doesn't support…

JohannesH
- 6,430
- 5
- 37
- 71
35
votes
1 answer
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 Permanently
server {
listen 80;
server_name…

accounted4
- 1,685
- 1
- 11
- 13
34
votes
27 answers
PHP Getting Domain Name From Subdomain
I need to write a function to parse variables which contain domain names. It's best I explain this with an example, the variable could contain any of these things:
here.example.com
example.com
example.org
here.example.org
But when passed through my…

zuk1
- 18,009
- 21
- 59
- 63
33
votes
3 answers
Cross sub domain iframes and JavaScript
I am working on a CMS site whose domain is:
http://www.acmssite.com
They have a sub-domain where they store a form system:
http://www.forms.acmssite.com
I have an iframe on the first that looks at a form in the latter.
I need to run scripts to…

RyanP13
- 7,413
- 27
- 96
- 166
32
votes
3 answers
Apache rewrite based on subdomain
I'm trying to redirect requests for a wildcard domain to a sub-directory.
ie. something.blah.example.com --> blah.example.com/something
I don't know how to get the subdomain name to use in the rewrite rule.
Final Solution:
RewriteCond %{HTTP_HOST}…

Sam
- 5,416
- 7
- 47
- 49
32
votes
3 answers
On heroku, is there absolutely no way to redirect an https naked domain on heroku to it's non naked domain with wwws?
Have a look at this link from the Heroku docs:
https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords#subdomain-redirection
The yellow boxes says:
Requests made directly to naked domains via SSL (i.e.
https://mydomain.com) will…

CafeHey
- 5,699
- 19
- 82
- 145
31
votes
3 answers
IIS 7 SSL for multiple sites with a single IP
I have a single IIS 7 server with a single IP address. Site 1 has an SSL cert for www and Site 2 has a wildcard SSL cert for various subdomains. Both sites use host headers to direct traffic off the single IP address. However, when I try to access a…

Unknown Coder
- 6,625
- 20
- 79
- 129
31
votes
3 answers
Mailgun messages from subdomain without MX record get rejected by some mail-providers
I'd like to use Mailgun to send e-mails from a web application, sending newsletters as well as transactional mails.
I set up a sudomain "subdomain.domain.tld" and configured the DNS as specified on the Mailgun panel, except for the (optional) MX…

theister
- 903
- 1
- 8
- 9
31
votes
12 answers
How to get a subdomain using window.location?
If I have a hostname such as: http://sample.example.com and in Javascript I do window.location.hostname, would I get "example.com" or "sample.example.com"?
If not, how would I be able to get sample.example.com?

LB.
- 13,730
- 24
- 67
- 102
30
votes
6 answers
Wildcard subdomains in IIS7. Is it possible to make them like it is in Apache?
Is this possible to configure IIS7 to achieve the same functionality like Apache has regarding wildcard domains? I'm interested in routing user in ASP.NET web application based on subdomain user used in URL.
Something like is described…

GrZeCh
- 2,332
- 8
- 29
- 38