To fulfil the requirements of the PubSubHubbub 0.4 spec, I have to send a rel=self
header for each file.
I'm now trying to do that with Apache's mod_headers
and environment variables:
Header append Link '<http://example.org%{REQUEST_URI}e>; rel="self"'
This works as long the file is processed by PHP, but does not for static files (like *.htm
) which are not processed by mod_php
or any CGI process.
There does not seem to be a way to get a list of all current Apache environment variables, so I can't check which ones are actually available.
So my question is: How can I access the relative path of the current requested URL in the Header append
directive?
Happens on Debian 7 with Apache 2.2.22-13+deb7u4
.
Nick Kew on the apache mailing list gave me an answer:
REQUEST_URI
is a CGI environment variable. The variables are not avaiable for performance reasons if CGI is not used for a file.You should be able to use many of the Server Variables that are available to directives such as RewriteCond (http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond)
Enabling mod_rewrite and adding "RewriteEngine on"; that should cause the variable to be populated.
If that isn't enough to populate the server variable you need, then you should also post the httpd configuration and OS details (eg. a lot of vendors versions of httpd 2.2, such as Red Hat's, have a lot of back-ports).