Apache 2.2 - "Allow from" only if QUERY_STRING matches -


i'm trying limit 1 of servers 1 specific request, after 2 hours of trying couldn't come working solution. i'm looking similar <if ...> directive, have apache 2.2 (this fact, , cannot update 2.4).

i have 4 servers: frontend[1-3] , backend1. frontend[1-2] allowed on backend1, frontend3 should allowed make 1 specific request. in apache 2.4 this:

<location />     order allow,deny      allow frontend1     allow frontend2      <if "%{query_string} =~ /foobar/myfunc/[^/]*$">         allow frontend3     </if> </location> 

how can same in apache 2.2? tried using setenvif, since hasn't got logical , mess , didn't work (i have match host and url, since frontend3 allowed "myfunc").

found way of mod_rewrite:

rewriteengine on  # matching host "frontend3" rewritecond %{remote_addr} ^1\.2\.3\.4$ # matching request "/foobar/myfunc?do=something" rewritecond %{query_string} ^do=something$ # setting environment variable if host & request match rewriterule ^/foobar/myfunc$ - [e=allowthis:1,l]  <location />     order allow,deny      allow frontend1     allow frontend2      allow env=allowthis </location> 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -