Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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

http://myurl.fake.com/book/getBook3?id=234 
http://myurl.fake.com/book/getBook1?id=xxx

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

Thanks!

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.