How to match a string in URI with regular expression?

Posted by forestclown on Server Fault See other posts from Server Fault or by forestclown
Published on 2012-05-31T06:26:07Z Indexed on 2012/05/31 10:42 UTC
Read the original article Hit count: 377

Filed under:
|
|

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!

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-rewrite