Easily generate PDF http header canonical for apache and nginx servers.
This is how you create the HTTP headers:
- Create Excel file with two columns (or download the sample file here).
- Column A contains the full path to the PDF file, column B the target URL for the Canonical
- Add more PDFs and URLs as separate lines.
- Upload the Excel file below this list & then press the “Generate” button.
- Copy the ready-made code for the .htaccess (Apache Server) or for the nginx.conf (Nginx Server), set it in the respective files on the server and save it.
Canonical tag in http header vs tag in head of html pages
Canonical tags are great, but they are mostly used only on HTML pages. It is also interesting to use them for other file types. For example, a PDF file could “link” to the HTML version via a Canonical tag. Google visitors would then see the HTML page and not the PDF.
This is interesting, but also involves some configuration effort, because the tag has to be inserted into the HTTP header. Of course, this can be done by configuring the web server, but it’s a bit inconvenient.