[Mod_gzip] Need some exclude syntax help

mod_gzip@lists.over.net mod_gzip@lists.over.net
Tue, 9 Dec 2003 18:55:20 +0100


Hi Chad,


> I have been trying to have mod_gzip include say "file.xml",
> but exclude "file.xml?printfriendly", but I haven't had any luck.
>
> Does anyone have any ideas on how to to that?

This might become a tricky thing.

"mod_gzip_item_exclude file" won't help you, and I am not sure whether
"mod_gzip_item_exclude uri" would see the query_string - this could be
removed already by some Apache API handling.
(To be sure, I just tried that myself, and it didn't work for me either.)

I had a similar problem once and decided to avoid it by using a symbolic
link pointing to the same ressource and having a "nogzip_" prefix in the
file name, which can then be used in both "file" and "uri" exclude rules.
So in your case you might link to "printfriendly_file.xml"... or you might
exclude the "MSIE" user agent from getting this URL in compressed form
("mod_gzip_item_exclude reqheader MSIE", maybe within some container)

If you don't have symbolic links (like on Windows platform) you might use
mod_alias to emulate these, again maybe via some container.

And if you want your original URIs to remain compatible, you might want
to use mod_rewrite to map them to the prefix scheme described above.

Regards, Michael