Summary: | mod_rewrite not adding Vary header | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Daniel Lescohier <daniel.lescohier> |
Component: | mod_rewrite | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.4.3 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Daniel Lescohier
2013-02-01 22:09:12 UTC
In directory context, action flags AND a substitution together don't work because it is not carried forward for the "internal redirect" used to change the URL. Output headers specifically are not preserved across an "internal redirect". Your best bet is configuring this outside of <Directory> context. I moved all my RewriteRules (and RewriteConds) out of Directory context, and edited them for the server context, and it now works. I see now that Directory context runs in a totally different phase of request processing; the fixup phase instead of the uri2name phase, and that the fixup phase processing does an ap_internal_redirect if you rewrite the url, and therefore the request parsing phase is done over again in the subrequest, and from what you said, response headers are reset for the subrequest. I would guess that this would mean that in Directory context, not only setting the Vary header from RewriteCond's %{HTTP:header} processing wouldn't work, but probably also the cookie|CO flag and perhaps the type|T flag would not work. I think it'd be a good idea to add documentation about this to: 1. RewriteCond's %{HTTP:header} documentation. 2. RewriteRule's "Per-directory Rewrites" documentation. 3. RewriteRule's flags documentation for each flag that won't work in Directory context. |