Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In my Apache config httpd.conf, I wish to setup a rule like below

SetEnvIfNoCase %{QUERY_STRING} ^.*(getBook+)$ no-gzip dont-vary

I am hoping to do no-gzip when my URL looks like


I am not sure if I can do that by setting up something like the above in httpd.conf..

The reason I do query string is because the url myurl.fake.com/book/getBook3 was mod_rewrite from myurl.fake.com/index.php?controller=book&action=getBook3


share|improve this question

1 Answer 1

The following rewrite rule below the first rewrite rule should do the trick:

RewriteCond %{QUERY_STRING} ^id=[0-9]*$
RewriteRule ^(/book/getBook(1|3))$ $1 [E=no-gzip:1,E=dont-vary:1,QSA]

Make sure your first rewrite rule for myurl.fake.com/index.php?controller=book&action=getBook3 does not have the 'L' flag

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.