httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jc <>
Subject [users@httpd] mod_rewrite, APR_HOOK_MIDDLE, and HTTP response headers
Date Wed, 13 Mar 2013 20:42:09 GMT
Hi all,

I am using apache 2.2.22 and an in-house apache module, which contains a
hook that sets an HTTP response header.  That hook is registered with

mod_ourmodule.c: ap_hook_thing(thing, NULL, NULL, APR_HOOK_MIDDLE);

This normally works, but if the request is rewritten internally by
mod_rewrite, the response will not contain the header that our module
has set.

Is this behavior expected?  If so, how should the hook be written so
that it can add response headers on requests that are internally
redirected?  For example, in .htaccess:

RewriteRule ^test$ test.php

I should mention that I have tried changing the order of the LoadModule
statements for our module and mod_rewrite, and got the same behavior. 
That is, in the example above, requests to /test.php contain our
module's response header, while requests to /test do not.


Jonathan Cooper

View raw message