1

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

1 Answer 1

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.

8
  • 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). Mar 8, 2022 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? Mar 8, 2022 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. Mar 8, 2022 at 21:14
  • 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. Mar 8, 2022 at 22:41
  • 1
    @GeoffAtkins good idea, I added a bit about how they change. Mar 9, 2022 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.