Absolute and relative links have been used for quite a time now. And, the debate on which is beneficiary in the SEO world continues even today. Over time, the significance of each has been contested, but it is widely regarded that absolute links provide better SEO value on the whole than relative links.
Even though it was once common to code relative URLs and links into a site for developers, it is slowly diminishing in present day. To be clearer on this subject, we will discuss about relative and absolute URLs in details here.
An absolute link is the hyperlink that includes all the information to find a site or a document or any other related thing from the web. The information includes the protocol required to get that particular document, the domain name of the site, the directory or subdirectory and the file name of the document.
In a relative link, the server knows where the current document. This means whenever you need to link to another document in the same directory, you can simply use the file name without writing full URL.
Between these two, Google recommends absolute links because they are less likely to be missed by the crawlers.
They are mainly used because they are much easier and faster to code. Moreover, they are also easier for website maintenance. On the other hand, it can lead the test environment to be completely indexed.
Some content management systems also have a staging environment on its own domain. Having relative URLs mean that the same website can exist on staging and on production, or the live accessible version of your website. It is not necessary to go back in and recode all of those URLs which is more efficient for web developers.
Duplicate Content Issue is another major concern of using relative URLs and linking. In terms of SEO, this duplicate content will only harm your overall rankings. At any given time when relative URLs are used, a website can have various different configurations which can give rise to duplicate content issues. If Google sees different versions of your website, it will figure out the real version and rank that only one.
From SEO perspective, absolute linking is recommended for the following reasons:
1)Fix the server side of your website
You have to resolve all of these different versions of your domain [www, non www, HTTP and HTTPS] to a single one version of your domain.
2) Fix your internal links
After you have fixed it on your server side, it is time to fix your internal links. In the meanwhile, recoding them to an absolute link is a must taking duplicate content issue into consideration. Navigational elements are one such part where you should not forget to update them to absolute.
3) Canonicalize it!
If internal link fixation takes time to complete, proceed on to canonicalizing all your pages to reduce the risk. You must change your server to resolve all of the different versions of your domain into one as well as apply the canonical tag on all the pages in website for self-canonization.
Now, you must be pretty convinced that absolute URLs and absolute links should be used all the times instead of relative URLs and linking. Canonical redirects and Canonical link elements should be on every page you serve out. After all just developing a website is not enough you should give that website a proper base for SEO in order for your pages to rank well in Google.