0

With the mod_rewite I want to send to my destination the IP address that made the request as a "GET" parameter, like

rewrite-once = (".*" => ".*?ip=$HTTP[remoteip]")

I tried with %a, %h, ".*?ip=" + $HTTP[remoteip].

Does anyone know that?

j0k
  • 22,600
  • 28
  • 79
  • 90

1 Answers1

1

Try this configuration:

$HTTP["remoteip"] =~ "^(.*)$" {
    url.rewrite-once = ("^(.*)$" => "$1?ip=%1")
}

You can use the % backrefrences to replace the match in the conditional.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220