{"id":213282,"date":"2024-02-21T10:17:07","date_gmt":"2024-02-21T18:17:07","guid":{"rendered":"https:\/\/www.bruceclay.com\/?p=213282"},"modified":"2024-03-05T10:02:38","modified_gmt":"2024-03-05T18:02:38","slug":"absolute-vs-relative-url-linking","status":"publish","type":"post","link":"https:\/\/www.bruceclay.com\/blog\/absolute-vs-relative-url-linking\/","title":{"rendered":"Absolute vs. Relative URL Linking: What\u2019s the Big Deal, Anyway?"},"content":{"rendered":"
<\/p>\n
A website\u2019s internal linking<\/a> structure can have a big impact on your SEO program and your website. An age-old debate is using absolute URLs versus relative URLs when linking internally.<\/p>\n In this article, I\u2019ll address what those are and which you should ultimately choose. <\/strong> An absolute URL is a URL that includes the domain of the site. To be more precise, an absolute URL is the full URL address including protocol (HTTP or HTTPS), subdomain (if any), domain, path and file name.<\/p>\n Here is an example of an absolute URL used in internal linking:<\/p>\n <a href=“http:\/\/www.example.com\/category\/topic.html”>anchor text<\/a><\/strong><\/p>\n <\/a><\/p>\n A relative URL is a URL that only includes the path to a file or webpage. In other words, it includes only a part of a full URL.<\/p>\n Here is an example of internal linking using a relative URL:<\/p>\n <a href=“\/topic.html”>anchor text<\/a><\/strong><\/p>\n A relative URL assumes that the link that is added is part of the same domain and follows the same path as the current page.<\/p>\n For example, if you link from http:\/\/www.example.com\/category\/topic.html<\/a> using <\/a><\/p>\n There are several different reasons that one might choose an absolute URL or a relative URL when linking internally. I\u2019ll go over some of those reasons now.<\/p>\n Absolute and relative linking can be used in new and existing websites.<\/p>\n Using relative URLs is typically a coding preference among web developers, particularly for new websites, because it is easier to move them from a dev environment to production.<\/p>\n Website migrations<\/a> can be easier with sites that have relative URLs, too (think moving from HTTP to HTTPS<\/a> or changing your domain name). The relative links will work right away without having to be redirected.<\/p>\n Some may also see slightly faster load times with relative URLs, too, but the difference is very small.<\/p>\n Duplicate content issues can creep up with relative URLs, but not with absolute URLs.<\/p>\n Let\u2019s say you have an HTTP version of your website and an HTTPS version of your website (meaning you have not 301 redirected<\/a> the HTTP version to the HTTPS). If you use an absolute URL when you link, there is no question which domain the webpage resides on because it contains the full URL path.<\/p>\n However, if you were using relative URLs, search engines like Google may assume that the link refers to both the non-HTTP version and the HTTPS version. In this case, the search engine may index both pages.<\/p>\n Another reason people choose absolute URLs is to preserve the crawl budget \u2014 the number of pages the search engine can crawl and index within a timeframe.<\/p>\n Google has indicated<\/a> that bad links can impact the crawl budget. This includes the duplicate content issue that can arise with relative URLs.<\/p>\n An absolute URL \u2014 while potentially more work upfront \u2014 is easier to maintain in the long run. Not only is it easier for the search engines to understand, but it prevents links from easily breaking, prevents duplicate content issues and preserves the crawl budget.<\/p>\n Google has weighed in on this issue in the past. In 2018, Google\u2019s John Mueller tweeted that the whole absolute versus relative linking doesn\u2019t matter for SEO:<\/p>\n Nope, not for SEO.<\/p>\n \u2014 🧀 John 🧀 (@JohnMu) July 4, 2018<\/a><\/p><\/blockquote>\n
\n<\/p>\n\n
\n<\/a><\/p>\nWhat Is an Absolute URL?<\/h2>\n
What Is a Relative URL?<\/h2>\n
\n<a href=“\/subcategory\/topic2.html”>anchor text<\/a><\/strong>, the link will take you to http:\/\/www.example.com\/category\/subcategory\/topic2.html<\/a>.<\/p>\nAbsolute vs. Relative URLs: Which to Choose<\/h2>\n
Why People Choose Relative URLs<\/h3>\n
Why People Choose Absolute URLs<\/h3>\n
The Verdict<\/h3>\n
\n