CityHost.UA
Help and support

Difference between absolute and relative URL

 6328
24.06.2020
article

In the article, we will take a detailed look at the difference between both formats, so that you can decide which is more suitable for you. If the URL structure is intelligently created, you will have no problems with its functioning, there will be no question of indexing and recognition of the site by search engines. It is important to remember: for correct work, all links on the web page must be brought to the same format, either absolute or relative.

Features of an absolute URL

An absolute URL will tell you the exact location of the page. It looks like this: https://www.somewebsite.com/catalog/category/product

The specifics of the relative URL

The address contains only the end of the URL. By specifying it in HTML, you will be able to link product and category pages (that is, make a link from one page to another). A relative link on a specific page will be used as the root.

Read also : What is link ranking .

So what does an analysis of the essential differences between the two formats tell us? The first is more complex but safe, the second is used as a link between pages, but it is more vulnerable. Now you need to figure out which format and why you should choose it. Let's consider all the pros and cons.

Pros of Relative URL:

  1. The code is compact. Web developers most often use this link because it makes things easier. So, the code itself is short and it allows you to link pages to each other. In order not to do unnecessary work and not to prescribe in detail the entire link for thousands of pages, we recommend using the short "/product". Then it becomes clear that the search object is located on a specific site, in a specific category.
  1. Simplifying the transition from the test field to the working field. Let's imagine that the test environment for the site is placed on a separate domain, then the absolute URL of the page should be written as follows: https://www.somewebsitestaging.com/catalog/category/product. As you can see, the code is quite long. When you have thousands of pages in your work and at some point you need to collect them together, you will have to spend titanic efforts for this unnecessarily difficult work. In this case, it is better to use a relative URL, with which the test creations are transferred to the working environment with one click, and links in relative addresses will be applied in the new domain. This will speed up the process and make the task more efficient.
  1. The download speed will increase slightly. With the help of short addresses, pages load faster. But don't try to solve speed problems just like that. We draw your attention: this is not a panacea, with the help of short addresses the page loads faster. These links make it possible to slightly speed up work, but if you are faced with a slow response of the site, you need to look for the problem deeper. Minus, one, but significant. To make a decision, you need to understand both the pros and cons of the option you choose. In this case, it is duplication, or, to be more precise, cloning of versions. A relative format can create four varieties at once. And each of them will be perceived by the program as an original. At this stage, you have to intervene in the process manually to select the canonical version. Otherwise, Google will treat each page as a unique sample. Of course, the developers of the search algorithm have already learned to automatically detect the main version, but this process is subject to errors, so manual intervention cannot be avoided.

Why is duplicate content so harmful?

Duplication, as well as spam links, entail severe sanctions. And in general, a bad scan can lead to the de-updation of your site. Google allocates significant resources to network identification so that all updates and changes are reflected in search results. There is a special limited crawling budget that is given to each site. The amount of this budget will depend on how often you update, how many visitors you have, and the structure, complexity and size of your platform. But if you cloned the page, the program will divide the budget into four parts, and you simply will not have enough money for normal functioning. As a result, many of the updates and changes will not be identified, and old information will remain available. Worse, if duplicate pages are regularly detected, your budget, as well as the frequency of visits, can be cut.

To prevent such troubles, you need to choose a more complex link. With absolute URLs, there are no such surprises. The search system sees only the original version of the site, without being distracted by duplicates, so in this case only new information will be available.

What are the risks of web scraping?

As we said, with the help of a relative URL, you can easily move content from the test database to the working domain. But there is a danger in the unfair competition of competitors, when they can use this link and steal your content for their own use.

Read also : How to make a URL correctly .

Absolute URLs guarantee intellectual property protection. It is too difficult to rewrite the web addresses of all pages, and dishonest people look for more affordable options.

How to make an absolute URL effective?

First of all, you need to set the correct format:

  • For canonicalization of the main version, it is better to use the HTTPS protocol, because HTTP is perceived by Google as unreliable.
  • Avoid using www.. It makes the URL long and has no effect on SEO.
  • Developers should understand that the absolute URL is a priority for you and you should use it.
  • Internal navigation links should also be aligned with each other.
  • Please note to developers that every non-standard case of URL usage must be reported.
  • Use Screaming Frog or similar programs to detect links that do not meet the request.
  • Be sure to canonicalize the major versions to avoid errors.

Let's summarize

Each URL format can and should be used in certain cases (see above). If you need to save time and you are not worried about security, it is better to use relative links. If you are afraid of fraudsters who can use your content, choose an absolute link. We will also remind you that the latter will save you from problems with duplication of the site, and as a result, you will save the crawling budget.

Note that with all the advantages of the absolute URL, the second option should not be rejected. It is important to understand what your goal is when choosing between formats. Therefore, weigh all the pros and cons before making a decision. The most important thing is that the format you use is the same for all pages of the resource. This way you will avoid mistakes and simplify the work both for developers and for the search engine.


Like the article? Tell your friends about it: