Forum Discussion
Phil_Lawrence_7
Nov 11, 2011Nimbostratus
Irule to redirect based on host and uri - lowercase issue
Hi
We are using BigIP v9.x
Im new to irules and I have done some searching on this forum and from the examples I've found ive managed to write the following (which works)
...
nitass
Nov 11, 2011Employee
not sure if i read your rule correctly or not. please feel free to revise.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.65.152:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set http_uri [string tolower [HTTP::uri]]
if {[string tolower [HTTP::host]] equals "ecm.express.tnt"} {
if {$http_uri ends_with "&lang=anon&country=anon"} {
set dnum [URI::query $http_uri "objid"]
set action [URI::query $http_uri "objaction"]
if {$action equals "open" and $dnum ne ""} {
HTTP::redirect "http://ecm.express.tnt/otcs/livelink.exe?func=LL.login&username=Anonymous&password=&NextURL=%2Fotcs%2Flivelink%2Eexe%3Ffunc%3Ddoc%2Efetch%26nodeid%3D$dnum"
} else {
do something else
}
}
}
}
}
[root@ve1023:Active] config curl -I "http://ecm.express.tnt/livelink/livelink.exe?func=ll&objid=149998544&objAction=open&lang=Anon&country=Anon"
HTTP/1.0 302 Found
Location: http://ecm.express.tnt/otcs/livelink.exe?func=LL.login&username=Anonymous&password=&NextURL=%2Fotcs%2Flivelink%2Eexe%3Ffunc%3Ddoc%2Efetch%26nodeid%3D149998544
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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