1

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!

quanta
  • 50,327
  • 19
  • 152
  • 213
forestclown
  • 895
  • 4
  • 15
  • 24

1 Answers1

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