Forum Discussion
Rakesh_125845
Nimbostratus
Jan 31, 2018Traffic redirection
" Tokenized string" [a-Z]{1,6}[0-9]{1,15}
can anyone help me in writing an F5 irule for the following ?
I want to redirect the following URLs:-
1) https://sfobjtest.govnet.nsw.gov....
Kai_Wilke
MVP
Feb 01, 2018Hi Rakesh,
you may take the snippet below as a starting point...
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] eq "sfobjtest.govnet.nsw.gov.au" )
and ( [string tolower [HTTP::path]] starts_with "/id:" ) } then {
HTTP::respond 307 Location "https://sfobjtest.govnet.nsw.gov.au:8443//documents/[findstr [HTTP::path] "/id:" 4 "/"]"
}
}
The iRule uses a
[findstr [HTTP::path] "/id:" 4 "/"] syntax to parse the [HTTP::path] for the first ocourence of the string /id:, then skip 4 bytes (aka. /id: is skipped) and then take the remaining [HTTP::path] till the next ocourence of /.
Note: If the iRule does not work out for you, then please reply with Real-World examples of the two URLs formats that need to become redirected...
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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