1

What is the difference between a hyperlink and a permalink. Please provide an example explaining the difference of them.

ConSod
  • 113
  • 3

1 Answers1

1

They both have to do with uniform resource indicators (URIs), but they are otherwise fairly different concepts. To set the stage, I'll define URI first. A URI is an address that can refer to a page or concept from the web. An example of a URI is https://example.com/page.html.

A hyperlink is what links to a URI in an HTML document. The code for a hyperlink looks like <a href=https://example.com/page.html>Anchor Text</a> and it renders showing the anchor text. When you click on it, it takes you to the URI. Most people say "link" rather than hyperlink, and URIs are sometimes colloquially called "links" as well.

A permalink is a URI in a content management system (CMS) meant to be the permanent home for a piece of content. The need for permalinks comes from the practice of blogging where the home page of the blog often shows the full text of the most recent blog posts. This list is called the "blog roll." Because the content on the main page shows only the most recent content, each blog post needs a separate long-lasting URI which is called a "permalink." So if the blog roll is on the URI https://example.com/ the permalink for the most recent blog post shown there might be https://example.com/my-blog-post. You could use either URI to view the blog post right now, but only the latter of those URIs would be expected to show the same content in the future. Permalinks aren't always truly "permanent." They can be changed with redirects or return an error status if the content is deleted.

Stephen Ostermiller
  • 98,758
  • 18
  • 137
  • 361
  • 1
    Technically the address of a webpage in an URL, but since URLs are a subset of URIs it works too (an URL both identify a resource and gives information how to access it). Also URIs were "extended" to be internationalized and called IRIs (see RFC3987). – Patrick Mevzek Mar 08 '22 at 19:20
  • 1
    Hyperlinks can link to any URI, including non-URLs like ISBN URNs, so I wanted to use that terminology even if "address of a page" is a bit of a simplification. Not that it is worth splitting hairs over because the W3C says that "URL" should mean the same thing as "URI" and that it is no longer useful to say that there are some URIs that are not URLs. See What is the difference between a URI and a URL? – Stephen Ostermiller Mar 08 '22 at 19:41
  • Then we disagree with: "A URI is a web address " but depends what "web address" means. For me it would probably mean HTTP(S) so in which case it is an URL, which is a subset of URI. ISBN URNs certainly do not fit, for me, the "web address" term. – Patrick Mevzek Mar 08 '22 at 21:14
  • "the W3C says that "URL" should mean the same thing as "URI"" I am not seeing anything like that. They just say the terms are used interchangeably most often, and while there is a difference, it is often lost in the non technical crowd. They just defer work saying that someone at IETF/W3C should just define new things based on "contemporary views"... and this didn't happen AFAIK. – Patrick Mevzek Mar 08 '22 at 21:18
  • Also "Hyperlinks can link to any URI" is technically true, but in practice if the client (the browser) does not understand it, it is not very useful. Look at RFC8589 and URIs like leaptofrogans:Network-Name*Site-Name: yes you can include that as "hyperlink" in your HTML code, yet the browser has no idea what it is and at best can just launch an external client trying to implement it (as some did for telnet:, or tel: or others schemes) – Patrick Mevzek Mar 08 '22 at 21:22
  • 1
    It might be helpful to mention that a permalink is not set in stone. It is permanent only for the life of the website's current page structure. – GeoffAtkins Mar 08 '22 at 22:41
  • 1
    @GeoffAtkins good idea, I added a bit about how they change. – Stephen Ostermiller Mar 09 '22 at 00:18
  • @PatrickMevzek I understand your point about "web address" being ambiguous. I edited the definition of URI again to better reflect what I intended. – Stephen Ostermiller Mar 09 '22 at 12:39