Canonical Header Links for PDF files in httpd.conf

43 Views Asked by At

I'm attempting to setup Canonical links for a number of PDF files on my website.

I have urls with this path "**https://www.test.com/wp-content/themes/theme_TEST/pdf/fr/test_04.pdf**" knowing that I can have several languages instead of "fr".

In httpd.conf, i set this configuration

<DirectoryMatch "^/home/wwwTEST/test.eu/www/test/wp-content/themes/theme_TEST/pdf/[^/]+">
    <FilesMatch "\.pdf$">
        Header set Link 'https://www.test.com/Catalog.html?pdf=<%{REQUEST_FILENAME}e>; rel="canonical"'
    </FilesMatch>
</DirectoryMatch>

Restart Httpd Server Command

sudo service httpd restart

When i try to check the http status with https://httpstatus.io, i got this

enter image description here

How to correct to have the good name, and not null ?

0

There are 0 best solutions below