What Links to Use within the Website: Relative or Absolute

 Какие ссылки использовать внутри сайта, относительные или абсолютные Read more here: http://seoanalytics.pro/ru/internal-linking

 

Many amateur SEO specialists and webmasters wonder, what links to use on the website. Some specialists believe that it makes more sense to use relative links, while others assure that it’s best to use absolute links. In this post we’ll try to figure out the difference between these types of links and how and when to use them.

 

First, let’s figure out, how does a link looks like and what code is used to create it

 

how to links look like

 

In this example we’ve used a relative link where pagename.html is a page that you’ll be transferred to after clicking on “page about car”. You can see that this link doesn’t have a full address (full web address includes attrebutes http://www).

 

 

Here are some examples of relative and absolute links:

 

Relative links

  • index.html
  • /graphics/image.jpg
  • /main-folder/folder/file.html

Absolute links

  • http://www.mysite.com
  • http://www.mysite.com/graphics/image.jpg
  • http://www.mysite.com/main-folder/folder/file.html

The first visible difference is that absolute links always include the website domain name, including http://www, while relative links only specify the file or the path to the file.

When a user clicks a relative link, browser understands it as a path to a place on the current website. Therefore you can use relative links only to make internal links to files or pages, while it is recommended to use absolute links when referencing to a page or a file on another website.

Let’s consider advantages of relative links over absolute in more detail, what are the differences between the two and which one is it better to use?

 

 

Absolute links have the following advantages:

 

  • Active links are fully transferred to the copier’s website during automated copying;
  • Search engines better determine the main website mirror;
  • Proper work in RSS readers;
  • Page loads much faster, when files hosted on a third party server are used;
  • No problems with rel=”canonical”;
  • Safer in case of the site hack;
  • Safer when transferring to a new CMS;
  • Best to use when distributing content by e-mail.

 

Absolute link

 

  

Advantages of relative links with no protocol:

  • When http: and https: are used, there are now problems with protocols;
  • Google recommends to skip the protocol

 

Relative link 

 

 

Relative links without the host name have the following advantages:

 

  • No need to change the path in internal links when transferring to a new domain;
  • No problems in case if the website is hosted on several domains;
  • Makes the HTML code shorter, which also affects the website loading speed;
  • Short URL.

  

Relative links that are detected by the current location have following advantages:

 

  • Allow to test the website without connecting to the internet;
  • It’s easier to move an object to folders.

 

 

Conclusion

 

It may be concluded that there is no absolute advantage in using one of the link types. Both linking options are important for the SEO and one only needs to use them properly, taking into consideration the advantage of each type listed above.