What types of URLs are there, and what are they used for?
URLs can be distinguished by how their addresses are written and what they are used for: absolute URLs provide complete addresses and are commonly used for external links and emails; relative URLs express locations as paths and are primarily used for internal website links; canonical URLs identify the version of duplicate pages that you want search engines to index; and vanity URLs emphasize brevity and memorability, making them suitable for marketing and sharing. These four terms are not mutually exclusive categories at the same level: the first two concern whether an address is complete, while the latter two concern its purpose.
Absolute and relative URLs: Choose the format based on how the link will be used
An absolute URL includes all the information needed to locate a page or file, such as the protocol, domain, and path. A relative URL can express a location within a website using a path that omits the domain. The difference is not the subject of the content, but how much location information the URL provides.
- Absolute URL: For example, https://www.example.com/products/shoes includes the complete website address. This format is commonly used in external links, emails, or syndicated content to point to the intended resource.
- Relative URL: For example, /blog/first-post/ expresses a location as a path and is primarily used for internal links. It is shorter and usually easier to manage when a website is updated or migrated.
For a product link in an email, you can therefore use a complete URL that includes the domain; for links to articles within the same website, you can consider relative paths. A relative URL should not be treated as a substitute in every sharing context simply because it is shorter.
Canonical URLs: Handling multiple addresses for the same content
Canonical URLs are useful when duplicate or similar pages exist. Their purpose is to indicate the preferred version you want search engines to index, not to give a URL a more memorable name.
For example, if https://www.example.com/shoes/ and https://www.example.com/shoes/?page=1 display the same content, you can designate the former as the canonical URL. This example assumes that both addresses display the same content; the decision cannot be based solely on URL length.
Designating a canonical version helps search results display the appropriate version and reduces competition between these pages. These are its purpose and expected benefits, not a guarantee that search engines will use the designated version.
Vanity URLs: Making marketing links easier to remember and share
A vanity URL is a short, memorable, branded link, such as example.com/sale. It often redirects to an actual page with a longer or more complex address, keeping the public-facing URL concise.
These URLs are suitable for advertisements, social media, or printed materials: the focus is on making links more appealing and easier to share, rather than addressing duplicate content. According to Semrush, they can be created with a URL shortening tool or in a content management system, with a 301 redirect then set up to the actual page. Vanity URLs and canonical URLs solve different problems and should not be treated as interchangeable features.
URL types: perspectives from across the web
If an article will be linked to on a website and emailed to readers, what kind of link should you use?
For internal links, consider using relative paths because they are shorter and usually easier to manage when a website is updated or migrated. In emails, use an absolute URL that includes the protocol, domain, and path so recipients have the complete address. The two formats suit different contexts; the choice should not be based solely on length.
Does adding a parameter to a URL mean you need to designate a canonical URL?
Not necessarily. First, check whether the different URLs display duplicate or similar content. For example, if a URL with a pagination parameter displays the same content as the original URL, you can designate the version you want search engines to index as the canonical URL. This helps search results display the appropriate version, but does not guarantee that search engines will use it.
What can you do if a URL is too long for a print advertisement?
Consider using a short, memorable vanity URL that redirects to the actual page, making it easier for readers to remember and share. According to Semrush, these links can be created with a URL shortening tool or in a content management system, followed by setting up a 301 redirect. Their focus is on marketing presentation, not on specifying which version search engines should index.
References
- What Is a URL? Structure, Types, and Best Practiceswww.semrush.com · 2023-03-29T08:09:00Z — Discusses: If an article will be linked to on a website and emailed to readers, what kind of link should you use?; Does adding a parameter to a URL mean you need to designate a canonical URL?


Join the discussion 0 comments
What are you working through? Share a question or experience and let’s find the next step.
No comments yet. Start the conversation.