Forum Discussion
sunnyman67_1367
Nov 03, 2013Nimbostratus
URL rewrite through iRule
Hi Guys,
i have one "Performance (HTTP)" virtual server on F5-1600 series, and i want to change the URL "http://www.abc.com" to "http://partner.abc.com/xyz". i have tried all below scripts :
1-
...
- Nov 11, 2013
Hi Sunnyman,
This will work;
if { [IP::addr [IP::client_addr] equals 1.1.1.1] || [IP::addr [IP::client_addr] equals 1.1.1.2} { SNAT with 1.1.1.100 snatpool VM_SNAT_POOL_1_1_1_100 } elseif { [IP::addr [IP::client_addr] equals 1.1.1.11] || [IP::addr [IP::client_addr] equals 1.1.1.12} { SNAT with 1.1.1.100 snatpool VM_SNAT_POOL_1_1_1_200 }
But that's not a very scalable way of doing it if your list is going to grow. If it's going to grow then use an address datagroup, with values snatpool names, which you can use like this
snatpool [class match -value [IP::remote_addr] equals dg_sunnyman_snatpools]
or more correctly;
set snatpool [class match -value [IP::remote_addr] equals dg_sunnyman_snatpools] if {$snatpool ne "") { snatpool $snatpool }
sunnyman67_1367
Nov 09, 2013Nimbostratus
Hi again joanna, i've checked both commands. For some of URLs they are ok, but for some of them not! Do you have any other idea to maintain query part of a URI and only change the path part of that URI, except these three blow commands ???
HTTP::uri "/ABC/newPics?[URI::query [HTTP::uri]]"
HTTP::uri /ABC/newPics"?[HTTP::query]"
HTTP::uri "/ABC/newPics?[HTTP::query]"
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