Skip to content

Commit 0b9a7f5

Browse files
Correct relative URL (#42611)
1 parent c833741 commit 0b9a7f5

File tree

1 file changed

+1
-1
lines changed
  • files/en-us/learn_web_development/howto/web_mechanics/what_is_a_url

1 file changed

+1
-1
lines changed

files/en-us/learn_web_development/howto/web_mechanics/what_is_a_url/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ All of the following URLs are relative URLs:
133133
- Scheme-relative URL: `//developer.mozilla.org/en-US/docs/Learn_web_development` — only the protocol is missing. The browser will use the same protocol as the one used to load the document hosting that URL.
134134
- Domain-relative URL: `/en-US/docs/Learn_web_development` — the protocol and the domain name are both missing. The browser will use the same protocol and the same domain name as the one used to load the document hosting that URL.
135135
- Sub-resources: `Howto/Web_mechanics/What_is_a_URL` — the protocol and domain name are missing, and the path doesn't begin with `/`. The browser will attempt to find the document in a subdirectory of the one containing the current resource. In this case, we really want to reach this URL: `https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL`.
136-
- Going back in the directory tree: `../CSS/Reference` — the protocol and domain name are missing, and the path begins with `..`. This is inherited from the UNIX file system world — to tell the browser we want to go up by one level. Here we want to reach this URL: `https://developer.mozilla.org/en-US/docs/Learn_web_development/../Web/CSS/Reference`, which can be simplified to: `https://developer.mozilla.org/en-US/docs/Web/CSS/Reference`.
136+
- Going back in the directory tree: `../Web/CSS/Reference` — the protocol and domain name are missing, and the path begins with `..`. This is inherited from the UNIX file system world — to tell the browser we want to go up by one level. Here we want to reach this URL: `https://developer.mozilla.org/en-US/docs/Learn_web_development/../Web/CSS/Reference`, which can be simplified to: `https://developer.mozilla.org/en-US/docs/Web/CSS/Reference`.
137137
- Anchor-only: `#semantic_urls` - all parts are missing except the anchor. The browser will use the current document's URL and replace or add the anchor part to it. This is useful when you want to link to a specific part of the current document.
138138

139139
## URL usernames and passwords

0 commit comments

Comments
 (0)