say the url is http://google.com/something?hello=1234 put in your hosts file google.com 10.0.0.1
If your URL is http://www.google.com/something?hello=1234 put in your hosts file www.google.com 10.0.0.1
you don't include anything after the domain name in the hosts file. But you do include the exact whole domain
do `wget www.google.com/abcdefg?a=b -O index.html -d'
then look at the headers and you will see if it's going to 10.0.0.1 and see a GET header saying /abcdefg and any parameters should be there.
The hosts file is I suppose, meant to be like a quick DNS cache it at least works like that, so you don't specify anything after the domain in there, and also it won't remove it from the URL you enter into the browser. It just changes the domain into the specified IP and leaves the rest, which I suppose is what you want.
But you may want a web server that you configure, because if you do wget www.google.com/abcdefg
and it does 10.0.0.1 and that's your router configuration it's like accessing your router without entering user/pass so you might just get an unauthorized page back from your router. Besides the fact that there is no abcdefg directory on there.
You wrote " I tried doing this on my host file without success (even without the get parameters)" <-- that should read hosts file. And you should get an effect and understand what the hosts file means for the browser.
But if you want to redirect on a way that is conditional not on the domain, but on the directory/parameters, or on the domain+directory/parameters, such that the same domain can redirect you to different IPs, based on the stuff after the domin in the http request, then the hosts file won't do that and i'm not sure what will. You could look into if squid can but you might want to set it up as a transparent proxy as well as seeing if it can redirect in the manner that you want.