Re: Header set Link?

Dave Wreski <[email protected]>
Newsgroups gmane.comp.apache.user
Organization Guardian Digital, Inc.
Message-ID <[email protected]>
>> Header add Link "<https://%{HTTP_HOST}e%{REDIRECT_PDF_CANONICAL_URL}e>; rel=\"canonical\"" env=REDIRECT_PDF_CANONICAL_URL
>> However, the %{HTTP_HOST} variable doesn't seem to be set.
> I don't think you can expect that environment variable to be defined.
> Maybe you want to switch the value argument to use expr= syntax
> instead so you can use more built-in values.

Do you mean something like this? This doesn't appear to work :-(

SetEnvIf Request_URI "(.+)\.pdf$" PDF_CANONICAL_URL=$1\.pdf
Header always set Link "<%{HTTP_HOST}e%{REDIRECT_PDF_CANONICAL_URL}e>; 
rel=\"canonical\"" expr=%{REQUEST_URI} =~ m#(.*)pdf$#"

This is from the example provided in the docs

https://httpd.apache.org/docs/2.4/mod/mod_headers.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.