Forum Discussion
Hariharan_Padm1
Nimbostratus
Sep 13, 2018Rewrite 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
Sep 14, 2018when 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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects