while trying to inject an additional http header to mark the canonical url it is impossible to use the REQUEST_URI variable as follows:
<IfModule mod_headers.c>
<FilesMatch ".pdf$">
Header add Link "https://EXAMPLE.COM%{REQUEST_URI}e; rel="canonical""
</FilesMatch>
</IfModule>
In the result the rule is applied and an additional header line is created but instead of the returned header lines content
https://EXAMPLE.COM(null); rel="canonical"
I would have expected to see
https://EXAMPLE.COM/PATH/TO/MY/FILE.pfd; rel="canonical"
Any ideas why this happens and how to overcome it? Apache version is 2.4.59
Kind regards
Nazdravi
New contributor
Nazdravi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.