Hi, I'm using httpd-2.4.62 on fedora40 and I would like to
dynamically add a Canonical Tag to the HTTP Header. I set this in
my .htaccess in the document root. SetEnvIf Request_URI "(.+)\.pdf$" PDF_CANONICAL_URL=$1\.pdf However, the %{HTTP_HOST} variable doesn't seem to be set. Using "curl -I" displays this: I followed the example here: Can you explain where the REDIRECT_ is defined? According to the info at the stackoverflow link above, it appears to be a fixed variable that somehow prevents the header above from being duplicated during the second pass, but I don't fully understand. Is this the best way to do it? What if I wanted to move it to my
apache config instead of .htaccess? I tried moving it into the
VirtualHost config and it doesn't work. Maybe it's getting lost in
the .htaccess scanning? What am I missing?
|