Relative URL

A URL that excludes some information about the location of the resource, like the protocol (e.g. http:// or https://) or the domain (e.g. The referring page is going to assume the rest of the information that isn’t specified.

  • Analogy: Using a relative URL is similar to telling a friend who lives nearby your street name and number but not giving the town, state, country, or zip code (because the friend has additional context on you that can lead them to assume all of those additional pieces of information correctly). Using an absolute URL would be like writing a friend on another continent’s full address on a package — you need to communicate every detail to the post office, or the package won’t arrive in the right place.
  • Example: If there were a link on a page on to “/resources” (code shown below), the browser would assume that the path was referencing a page on the subdomain and take someone who clicked on that hyperlink to
  • Code: <a href=”/resources”>