Skip to content

HTTP Header Canonical Generator for PDF

Canonicalize PDF files with Canonical Tag in HTTP header – Our free Canonical Generator makes it easy and fast!

Are you currently ranking with a PDF document instead of the HTML page on Google’s search results page? You want to change that but don’t know how? Then you’ve come to the right place! With the help of referring canonical tags in the header area of your PDFs you can determine that Google prefers the HTML pages of your website for the evaluation of your ranking positions on the search results page. That sounds complicated? With the help of our generator you don’t need to be a web developer or technical SEO expert to tackle such issues. Our tool will automatically create the appropriate PDF Canonical Tags for you, both for Apache and Nginx web servers. In addition to this, our site includes further informative content for you on the topic of SEO compliant work with PDFs and Canonicals. We look forward to your use of our tool!

Our Canonical Generator:
Let your HTML pages rank in Google instead of your PDF files.

Let your HTML page perform on the search results page. Our tool from tiny web will take care of configuring Canonical Tags for Apache and Nginx web servers for you. We will give you step-by-step instructions on how to use our generators:

How our Canonical Tag Generator works – A Step-by-Step Guide

Creating Canonical Tags for HTML files is much easier, no concrete configuration is needed. However, creating a canonical tag for a PDF file requires a certain amount of configuration – and this is where our generator comes into play. Our tool from tiny.web creates a configured Canonical Tag for the HTTP Header of your PDF for the web servers Apache and Nginx – easy, fast and free of charge. Just follow our instructions – How to create the HTTP headers:

  1. Open an Excel file – this is where the preliminary work for configuring the tags for your PDF file takes place. You work here only in two columns – A and B.
  2. Optional: Download the sample file here and work directly in our template.
  3. In column A, enter the full path to your PDF file. Example: https://tinyweb.com/test.pdf
  4. In column B the canonical URL is entered, i.e. the URL with which you want to rank on the search results page. Example – we want to rank with an HTML page instead of PDF: https://tinyweb.com/test.html.
  5. You want to create a tag for further PDFs? Then you work here after the same procedure in each case in a new line.
  6. You have now saved the Excel file completely with all contents? Then click on “Choose File to Upload” and select your prepared Excel file.
  7. After that the “Generate” button will appear. Click it – the configuration of the canonical tag for your PDF file to the Apache and Nginx web servers will begin.
  8. You will now receive a ready configured code for the respective web server. You can download this code or copy it directly and implement it in the HTTP header of the PDF file on the respective server.
Column A: the path to the PDF file, Column B: the target URL of the Canonical tag (the page that should rank in Google instead of the PDF).
Column A: the path to the PDF file, Column B: the target URL of the Canonical tag (the page that should rank in Google instead of the PDF).

Example – Structure of a “rel canonical” in a .htaccess file for the web server Apache

The created code for the Canonical Tag for the PDF file https://tinyweb.com/test.pdf with the canonical HTML page https://tinyweb.com/test.html looks like this:

<IfModule mod_headers.c>
<Files ~*/test.pdf>
Header append Link "<https://tinyweb.com/test.html>; rel="canonical""
</Files>
</IfModule>

If you implement this code in the HTTP header of the respective PDF on the Apache server, the following information will be sent to Google:

Link: <https://tinyweb.com/test.html>; rel="canonical"

Example – Structure of a “rel canonical” in a nginx.conf file for the web server Nginx

The created code for the canonical tag for the header of the PDF file https://tinyweb.com/test.pdf with the canonical HTML page https://tinyweb.com/test.html looks like this:

location ~*/test\.pdf$ {
        add_header Link "<$scheme://$http_host/test.html>; rel="canonical"";
    }

If you implement this code in the HTTP header of the respective PDF on the Nginx server, the following information will be sent to Google there:

Link: <https://tinyweb.com/test.html>; rel="canonical"

Your advantages with the Canonical Tag Generator from tiny.web: Easy, fast, free of charge, web server independent!

Our SEO tool takes care of programming a Canonical Tag for you. You don’t need to learn how to do this or hire external services. Our generator creates the necessary “rel canonical” links for you quickly and free of charge. Just follow our instructions and you will soon have a configured Canonical Tag for the HTTP header of the respective PDF. A lower and simpler configuration effort is hardly possible here. Our tool creates the tags for both Apache and Nginx. Use our Canonical Tag Generator to keep your index clean so that the right content performs. Optimize your website for the search engine!

A short SEO excursion on the topic of the Canonical Tag: “rel canonical”.

Canonical tags are great because they allow to communicate to search engines the preferred content with which you intend to perform among search results. Primarily the tag is used for HTML pages. For each HTML page, a canonical link tag “rel canonical” is implemented in the head section of the source code to specify the preferred URL for ranking.

What is a Canonical Tag?

Canonical tags are a useful tool for search engine optimization, because a canonical link allows you to communicate to search engines the preferred content with which you intend to rank among search results. Canonical tags can be used with various file formats – such as HTML, PDF, DOCs, PPTs, XLSs and many other files. Classic SEO application example of Canonical Links: Web pages with products in different colors or sizes. For each version of color or size there is a separate URL in the Google index. What does the search engine see here? – Pages with very similar, if not identical content. This makes it difficult for the search engine to evaluate and differentiate the content in terms of ranking on the search results page. With the help of a canonical tag, you can communicate to Google which product URL should be displayed to the user preferentially. This logic distinguishes between a referring and a self-referencing Canonical Link. A referring canonical link has URLs that should not be displayed to the user on the search results page. A referring canonical link must also communicate the information to Google which URL should perform instead – the performing URL therefore has a self-referring canonical link. A URL with a self-referring canonical tag is also called a canonical URL. Important here, the content of the URLs where the Canonical Tag logic is used must have very similar or identical content. It should also be noted that a Canonical Tag is understood as a “soft” indication to Google. The specification does not give a 100% guarantee that only the canonical URL will be displayed.

Canonical Tag in HTTP Header vs. Canonical Tag in Head Area of HTML Page – What are the Differences?

As already explained in the introduction, canonical tags can be used for various file formats. However, it is known from practice that the canonical tag is often only used for HTML files.

HTML rel canonical tag in the head area – Let the search engines rank the right pages

You have decided which HTML page should be the canonical URL? Then you can start with the operational implementation: Here you implement a corresponding tag “link rel canonical href” in the head area of the source code. To avoid errors, Google recommends that you specify the canonical URLs as absolute links. We have prepared an example for you here:

On the web page www.example.com the product “shoe” exists, which is offered thereby in the colors “blue” and “red”. The different versions of colors are duplicated on two URLs. We have decided to communicate the "/shoe/blue" as a canonical URL to Google and the URL to the "shoe/red" as a copy to the "/shoe/blue". Therefore, the following specification would have to be implemented in the head area:

Canonical URL "/shoe/blue" with self-referencing “link rel canonical href” tag:

<link rel=“canonical“ href=“https://www.example.com/schuh/blau“ />

Copy of canonical URL "/shoe/red" with referring “link rel canonical href” tag to canonical URL:

<link rel=“canonical“ href=“https://www.example.com/schuh/blau“ />

“rel canonical” link in HTTP header – How to avoid ranking of your PDF URLs

The Canonical tag can also be used for other file formats. In this page we have focused on the use of the Canonicals tag for HTML and PDF. Since we have already highlighted the use for HTML pages, we will now move on to working with Canonical Tags for the PDF file type. You have prepared your content not only in HTML format but also in PDF format for your users? Then there are usually similar if not identical contents, which are listed in the Google index and therefore also evaluated for the ranking position. Therefore, it must also be determined here which content should rank in Google – HTML page or PDF? Here, too, we work accordingly with referring and self-referencing Canonical Tag. A placed referring tag from the PDF file to the respective HTML page would give Google the indication to display the HTML version of the content to the user instead of the PDF version within the search results. For PDFs, the “rel canonical” link is implemented in the HTTP header, which requires some configuration. This is where our generator comes into play – our tool takes care of the configuration for the Apache and Nginx web server. The tags are configured in the .htaccess file for the Apache web server. For the webserver Nginx the “rel canonical” tag is generated in the nginx.conf file. How the generated content looks like per web server, we have already listed above in the instructions for our tool.

Which URLs of my page should perform? – Tips for a SEO compliant decision!

You are faced with the question, which URLs of your web pages should perform? This is a fundamental question that should be addressed analytically before you start working with “rel canonical” links. We will give you some valuable SEO tips for this problem in the form of KPIs, based on their analysis, you can decide which version of the page should be discoverable via the search engines.

  1. SEO KPI: Traffic – Look in Google Analytics and in Google Search Console over which file or page more sessions are generated. Which HTML version leads to more organic traffic? Does the PDF version or the HTML page lead to a higher number of clicks in the organic area?
  2. SEO KPI: Rankings – With which version of content do you have better visibility via the search engines? That is, which URLs already achieve very good rankings, so that you generate a stronger findability with these URLs, which is accompanied by a higher click probability of the respective element. You can look at your rankings with the proven Google tools, but SEO tools such as SEMrush, Sistrix or Searchmetrics also provide very good assistance here.
  3. SEO KPI: Backlinks – A very important factor for Google, which also essentially determines the organic rankings of websites, is Trust or Authority. This factor results from the incoming links to your website from external sites, here we speak in SEO of backlinks. If these links come from domains with high strength and credibility, then these domains transfer a certain part of these factors to your website with the links placed on your pages. For a comprehensive analysis of your backlink profile you should not only work with one tool to get a complete count of all external links. Suitable tools for this are Sistrix, Google Search Console, Ahrefs and the Link Research Tools.

Choose the content that performs best in the evaluation of the three KPIs so as not to lose the organic performance of the respective content already gained here. As a rule, HTML pages perform better than PDFs. However, if a PDF performs better here, make sure that the user always has the option of navigating to your web pages. This can counteract a high bounce rate, which ultimately represents a negative user signal for Google and can have a long-term negative impact on the rankings of your web pages.

SEO compliant PDF files – Why does the use of Canonical Tags in the HTTP header of PDFs serve the search engine optimization of web pages?

Do you have pages on your website whose content is displayed as an HTML file as well as a PDF file? This is often the case in order to make content available to users for download. A service that is definitely coherent from an online marketing point of view. But should be explicitly defined from an SEO point of view with which content on the search results page in Google would like to be ranked – with HTML files or non HTML files? In general, Google takes into account the specification of a canonical link in the head area of non-HTML files when evaluating the content of a website. Thus, a canonical tag can be used to communicate to Google that HTML files should be given priority for ranking instead of a PDF file. This is also confirmed by a Twitter blog post by John Müller on this topic: Google takes into account information via Canonical Tag for the evaluation of PDFs but not for images.

Screenshot from Twitter about John Mueller's hint that Google considers and evaluates set Canonical Tags in the head area of PDFs.
Source: https://twitter.com/johnmu/status/768024243544133633

A white paper from Google Support on the subject of the Canonical Tag also supports this thesis. Here it is described that in the HTTP header of the PDF a referring tag with rel= “canonical” must be set to the appropriate HTML page to communicate the appropriate instruction to Google.

Provide unique content – Get around the problem of duplicate content by using Canonical tags to optimize your pages for the search engines.

Very similar or even identical content on several URLs of a website is evaluated by Google as duplicate content. The crawler of the search engine has the problem of a differentiated evaluation of the duplicate content with regard to its display on the search results page. Since Google would like to offer users a search results page with unique content and topics that optimally match their search intentions, the search engine does not know which URLs should best be displayed in the case of identical content. The consequences can be that none of the duplicated content performs on the search results page or Google even removes the URLs concerned from indexing so that they can no longer be found via the search engine. To avoid this, canonicals should be used. These “rel canonical” tags give instructions to Google as to which content should be given priority for ranking. Duplicate content also exists when identical content exists in different file formats on your website. If you offer duplicate content as HTML and PDF on your website, Google will recognize duplicate content here as well. Working with canonicals is therefore recommended from an online marketing and especially from an SEO point of view.

Keep users on your website for a long time – Let the right and user-friendly content rank in Google’s search results

An important topic in online marketing is the user experience. The Google algorithm is so intelligent that it also evaluates, in addition to a pure blog of text, other elements that make the user’s experience with the page friendlier. This includes bulleted lists, images, and videos, cross-references to other valuable content on the website. A pure blog of text desert on a page usually acts as a deterrent for users, which is accompanied by a high bounce rate, which Google ultimately evaluates as a negative signal of the page. With the help of an appropriately presented page, you can give the user a pleasant experience with the page and also keep him on the website as long as possible. PDFs are recommended from an online marketing perspective to allow users to download the content. However, what is often not considered here is that users do not have the ability to navigate their way back to the website and thus jump back to Google. If a PDF is ranked in the search results instead of the respective HTML element of your website, the user clicks on the PDF file and may not have the possibility to navigate to further content. Also, playing videos is not possible with PDFs, so an optimized user experience is only conditionally possible with PDFs than with HTML files. Therefore, from a user experience perspective, it is recommended to set a referencing canonical tag from the PDF to the respective HTML version.

Common mistakes when working with Canonicals – This is what you should know and pay attention to!

As with any topic in SEO, there are common mistakes that are made when working with Canonical Tag logic. We have listed here eight mistakes that are often observed in practice.

Error #1 – Using relative URLs instead of absolute URLs

The “rel canonical” should always include the full canonical URLs, to ensure that the tag also accesses the content in question. Using relative URLs can be misinterpreted by Google, which works against your website’s search engine optimization.

Mistake #2 – Using Canonical Tags on different page content

Canonical tags should only be used on pages when the content being mapped is very similar or even identical. The tags should not be used when pages each cover a sub-topic to an overarching topic. In this case, the search engine will recognize that the content is not sufficiently congruent and ignore the set canonicals.

Error #3 – Using tags to link from http www to https www

Google considers only the https www protocol as a secure connection. If a page still runs on the http www protocol, then Google plays the user here a corresponding security notice and recommends not to call such URLs. Therefore, it is recommended to redirect all URLs from http www to https www, so that the user can access the content accordingly. In some places, canonicals are used from the http www URL to the https www URL. In this case, however, it is recommended from an SEO point of view that 301 redirects are used. In general, never work with Canonical tags when changing URLs, but work with redirects.

Error #4 – Multiple use of Canonicals on different URLs

Only one Canonical tag should be set per URL. If there are multiple instructions here, Google will ignore the tags that have been entered and rank the URLs accordingly.

Error #5 – Canonical tag is set in the <body> area on HTML pages

Canonicals are to be maintained in the <head> area of the HTML source code. If Google crawls a tag in the <body> area this statement will be ignored.

Error #6 – Canonical tag on <noindex> or redirect page

Canonicals should never lead to pages you have taken out of the index. If a referring canonical link leads to a page with the tag <noindex> there is a contradiction for the search engine and decreases the quality of your page. Likewise, a canonical tag should never lead to a page that does not return the status code “200 OK”. In general, a Canonical tag should only lead to a URL with status code “200 OK” and meta robots tag “index”.

Error #7 – Using Canonicals on Parameter URLs

Parameter URLs usually represent duplicates of the “clean” URLs. Therefore, a Canonical tag should not lead to a parameter URLs but exclusively to the “clean” URL, since with this would like to be ranked.

Error #8 – Use of “rel canonical” in pagination

Often a “rel canonical” is set to the first page in a pagination to bundle the whole strength here. However, here is the same problem as with error #2 – the contents of the different paginations have different contents, which is why the Canonical tag logic does not apply here. You can set referring canonical links here to a page that maps all the content of the different paginated pages. From the SEO point of view, however, a better variant here is that the respective paginated pages have a self-referencing Canonical Tag and, in addition to this, the content of the paginated form is linked to each other via link rel=”next” and link rel “prev”.

Do you have any questions? Please feel free to contact us.

You want to optimize your online marketing and need support in the channel SEO? Feel free to contact us without obligation!