I'm stuck with a rewrite rule, probably because of the fact I don't understand regular expressions :(
What I want is the following:
If some asks for the URL
http://127.0.0.1/cgi-bin/cgifile?var1=1234$var2=somethingelse
It should rewrite it to:
http://%{REMOTE_ADDR}/cgi-bin/cgifile?var1=%{REMOTE_ADDR}:1234$var2=somethingelse
I have set it to do this when the Virtual Path Regular Expression is /cgi-bin/cgifile
Problem is, the rewritten URL is on the same server. So if I would launch this rewrite it would come in a loop becuase of the same Virtual Path.
I think it should be triggered by the condition if the first part of the URL is
http://127.0.0.1
Another condition could be to look if in the requested URL would be a match for the string "var1=1234" (because that part of the string is going to be rewritten it would be a safe condition).
can anyone help me with this problem?
=[EDIT]=
As allways, you find the solution right after posting your problem ;)
I was focussing on REQUEST_URL, bu I should use REQUEST_UR.
When I add the follwoing condition:
Variable: REQUEST_URI
Operator: matches with
Regular Expression: ^/cgi-bin/cgifile\?var1=1234(.*)
It works :)