Forum Discussion
hooleylist
Mar 29, 2012Cirrostratus
Hi Vytautas,
That looks close. HTTP::header returns the value of a supplied header name. I think you want to insert the host value. Or you could leave out the protocol and host and just redirect to a local URI. Also, you have an extra open parenthesis.
when HTTP_REQUEST {
if { ([IP::addr [IP::client_addr] equals 10.10.10.1]) and !([HTTP::uri] starts_with "/a1") } {
Absolute URL redirect to http:// with the originally requested host
HTTP::respond "http://[HTTP::host]/a1[HTTP::uri]"
Local URI redirect to http:// with the originally requested host
HTTP::respond "/a1[HTTP::uri]"
}
}
Aaron