2022 Developer Survey is open! Take survey.
31 votes
Accepted

Difference between CNAME and SUBDOMAIN

A CNAME is a type of DNS record, where a hostname points at another hostname. An A record is another type of DNS record, where a hostname points at an IP address. A subdomain is what you described ...
user avatar
  • 4,334
22 votes
Accepted

Why do browsers know to lookup the `www` record if DNS query for @ gets NXDOMAIN?

Browsers generally have heuristics built in to add missing www. from domain names, but it isn't something you should rely on: Browsers typically have a setting to turn off this "www fix up."...
user avatar
16 votes
Accepted

Can I use different nameservers for different subdomains?

Yes, You can. you will have to add the NS records for the subdomain in the DNS Manager for your TLD (Top Level Domain). For Example: In DNS Manager for TLD add NS records Like. bla.example.com. ...
user avatar
14 votes
Accepted

How are web applications like Tumblr, WordPress.com and Blogspot able to create subdomains for users so fast?

You're right that the trick is a wildcard DNS entry (indicated with asterisk) . Essentially it's a DNS entry that will match all subdomains that don't have a specific DNS entry. Then the "routing" ...
user avatar
13 votes
Accepted

How can I use robots.txt to disallow subdomain only?

You can serve a different robots.txt file based on the subdomain through which the site has been accessed. One way of doing this on Apache is by internally rewriting the URL using mod_rewrite in ....
user avatar
  • 41k
13 votes

Is there any way to use a sub-domain as your root domain

Indeed you can. For instance some do not realize a www. url is an actual sub-domain. So it is happening all the time. You can go to your server settings and choose your sub-domain as the main domain ...
user avatar
11 votes

Sitemaps - one per subdomain or one for the base domain?

Generally, you have to use a separate sitemap for each host (i.e., different protocol, domain, or subdomain): From the FAQ "Where do I place my Sitemap?": All URLs listed in the Sitemap ...
user avatar
  • 21.4k
9 votes
Accepted

Sitemaps - one per subdomain or one for the base domain?

As per Matt Cutts blog post, he said: A subdomain can be useful to separate out content that is completely different. Google uses subdomains for distinct products such news.google.com or maps....
user avatar
7 votes

Redirect Google crawler to different robots.txt via .htaccess

Google's bots will still want to request /robots.txt from your sub domain and not /robots_static.txt which would have no meaning to them. RewriteCond %{HTTP_HOST} ^www\.static\..*$ [NC] RewriteRule ^/...
user avatar
7 votes
Accepted

Subdomain of subdomain? How is it possible?

It's possible exactly the same way that unix.stackexchange.com itself is possible. DNS does not impose any specific hierarchy, like "subdomain – domain – toplevel", you can add as many labels as you ...
user avatar
  • 304
7 votes
Accepted

How do aliases or redirects work?

You most certainly do not have to buy store.xyz.com as a new domain name. store.xyz.com is a part of xyz.com A domain name is made up of multiple parts www.google.com www.google.com | | | --...
user avatar
  • 590
7 votes
Accepted

Cloudflare DNS: How to 301 Redirect all traffic from Sub Domain to Main Domain with URL path?

The error you are receiving is because CNAME's only support domain names and not URL paths. You can setup a redirect using your hosting account or Cloudflare Page Rules. 14 Step Cloudflare Process ...
user avatar
  • 32.6k
6 votes
Accepted

How to make Subdomains identified as separate sites by Search Engines

This is normal behavior. I am not sure what your question is exactly. But here goes. I am going to assume you are using Apache and host your DNS. Create the sub-domain on your server however you ...
user avatar
  • 32.5k
6 votes
Accepted

Implications of using subdomain or traditional folders SEO

You display companies information on your site, you need to use one website as a companies directory, it's logical. Option 1 Using a subdomain for each company seems complicated to maintain in the ...
user avatar
  • 10k
6 votes
Accepted

Should I use a subdomain or a subdirectory for SEO?

To start, I've never really found a hard and fast "best" answer here in terms of which setup will help you the most with Google. I've gone both routes and been able to get sites ranking in Google ...
user avatar
5 votes

What's the best way to redirect from domain to subdomain?

Setup both the domain and the subdomain in google webmastertools, and set your preferred version to be the subdomain one, then in the 'naked' domain (mydomainsite.com) if you are using apache, put ...
user avatar
  • 326
5 votes
Accepted

How to make Google consider subdomain as part of the main website in SEO?

Google will automatically treat subdomains as part of the main site when: They have related content They are written by the same person or company They link to each other From Vanessa Fox, an ex-...
user avatar
5 votes
Accepted

Can I place a robots.txt file inside a subdomain and it only affect that subdomain and not the root domain?

Yes. Whatever the web root for the subdomain is where you would put a robots.txt for that subdomain's contents. It will not affect the root domain and the root domain's robots.txt will not affect the ...
user avatar
  • 85.8k
5 votes
Accepted

Is it bad to have both www and the naked domain indexed in Google? Should both be added to webmaster tools?

I would recommended either using the www or non-www and stick with it. Set a preferred URL in Webmaster Tools and then 301 to either your www or non-www. The reason for this would be Google would ...
user avatar
5 votes
Accepted

How to implement WordPress in a subdirectory, hosted on a different server?

The subdomain is certainly the easiest option since you are wanting to host the site on another server. The reason for this is that a hostname can only ever resolve to a single location. If you are ...
user avatar
  • 635
5 votes
Accepted

Are multiple consecutive dots allowed in a domain name?

If I am reading the RFC correctly, labels (the parts in between the dots) in a domain name cannot be empty because the empty label is reserved: Each node has a label, which is zero to 63 octets in ...
user avatar
5 votes
Accepted

Making WWW. work for subdomain with no hosting?

www.give.example.com is exactly like give.example.com in the DNS, but they are separate names, so once you put a record for give.example.com that says nothing for www.give.example.com (except in cases ...
user avatar
5 votes

How can I make a URL on one domain "front" content from another domain?

This type of indirection is called a reverse proxy setup. To reverse proxy in Apache2, use the ProxyPass directive in your config for www.example.com: ProxyPass "/" "http://name....
user avatar
4 votes

How to access a website hosted on a shared server (and IP), when its domain is not working?

Your hosting provider should send you temporary URL for your hosting account and website. If they didn't, check your cPanel or whatever control panel and take out the ip address and paste it here: ...
user avatar
4 votes

How can I add sub1.sub2.example.com to my GoDaddy hosting account?

You can create a CNAME with dot notation in it. So you can create a CNAME which is es.n and point it to the a record and it will take care of what you want. This is done via GoDaddy DNS hosting (...
user avatar
  • 1,451
4 votes

How do I prevent subdomain finders finding subdomains on my server?

You can add a wildcard DNS record for your domain. Using that, every possible subdomain points at your server. Then your webserver can choose which subdomains have content and which subdomains ...
user avatar
4 votes
Accepted

Is example1.example.com called multiple domain or subdomain?

example1 and example2 are subdomains of mysite.com. Multi-domain just means a site can be accessed by more than one domain name. Ie.e. two domains pull up the same website.
user avatar
  • 85.8k
4 votes

Can I share a cookie with a subdomain?

Yes you can, try setting the cookie for .example.com as domain. That way, the cookie will be valid for every subdomain of yours. For example, PHP sessions would be like this: ...
user avatar
4 votes
Accepted

Does IIS 7.5 use a separate "AppDomain" for each subdomain?

No. I run several sites like this. The binding determines which app takes the requests, and each app can only have one app pool. An app pool can use multiple processes (a web garden) but that is ...
user avatar
  • 273
4 votes
Accepted

Put a Subdomain on a Different Server Hosting

This is relatively easy to do. Using example.com, you have: An A record for the example.com A CNAME (as an alias) pointing www to example.com (www is a sub-domain) --where www = example.com -- or -- ...
user avatar
  • 32.5k

Only top scored, non community-wiki answers of a minimum length are eligible