Forum Discussion
Hariharan_Padm1
Nimbostratus
7 years agoRewrite URL using irule from internal to External
Hi All,
I am trying to rewrite URL from internal to external by applying the mask on header. It is working as expected using below irule however if I select some hyperlink or option, its showing...
PeteWhite
Employee
7 years agowhen HTTP_REQUEST {
if { [HTTP::host] eq "123.abc.com" and [HTTP::uri] contains "/xyz/" } {
if {[string tolower [HTTP::uri]] contains "/xyz"}{
set uri [string range [HTTP::uri] 4 end]
HTTP::uri $uri
HTTP::header replace host "www.google.com"
pool testGoogle
log local0. "[IP::client_addr]:[TCP::client_port]: Replacing Host with http://[HTTP::host][HTTP::uri]"
}
}
}
Presumably it doesn't rewrite the URI after the change because the host header of no longer matches 123abc.com. Why aren't you just using a redirect to