Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Chen Wang
Chen Wang
7,371 Points

A quick question about domain name

If I have a domain name, for example, "abcd.com".

I know that if we put a blog.html in the home directory, we can get a "abcd.com/blog".

My question is: I saw many people's blogs are like "blog.abcd.com". How did they implement this? Are there any difference from the perspective of development?

3 Answers

getting a domain like "xyz.mysite.com" are called sub domains.

You can add a sub domain through your host provider and you can than link that sub domain to any section of your site.

Kevin Korte
Kevin Korte
28,148 Points

What you are referring to is called a subdoamin. Usually, you can set those up pretty easily in your host dashboard. Subdomains act like separate sites from the main domain.

And to clarify if you put a blog.html in the home directory you would have abcd.com/blog.html as the domain. If you wanted it to be just /blog you would create a folder instead called, blog, and inside the folder move the blog.html file inside that folder and name it as index.html, and you'll get the desired URL results.

To be more specific, the xyz of the xyz.mysite.com is the HOST and can be referring to a different server or subdomain in the domain environment of mysite.com. So there might be servers called mail or web or www or FTP with the extension of domain of mysite.com.

You then use the DNS to point to the host name.

To answer the question specifically, you would go to your domain management tool and add in a DNS record referencing BLOG and point to the hosting server IP address.