Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Going Further with HTML Root-relative Paths

so if i were to make a website on my own, for another person which would i use "../" or "/"

?

1 Answer

Louise Iyengar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Louise Iyengar
Full Stack JavaScript Techdegree Graduate 21,967 Points

You would always use "/" to access the root directory of any website on a server -- the start of a root relative path (as in <a href="/">home</a>).

Servers that host many different websites will be configured so that they can 'pretend' each site is unique on the server, and each site on the server will have its own root directory.

Servers that host many websites will often specify a directory to put webpages in (something like httpdocs or public_html) and each website will have a directory with this name. This directory will be the "/" for each site on the server.

You can also specify the first page that should load from the directory when the root path is accessed (usually index.html by default -- but this can be changed to index.php or main.js, for example). Therefore, the start of the root relative path for your website will bring up this page.