Forum Discussion
Gbps_31870
Sep 11, 2012Nimbostratus
iRule for replace URL characters and do Base64 Encoding
Hi,
Is is possible to achieve the below scenario.
URL: www.example.com/xyz/xyz.do?asar=equal?x=xyzw.xyzw.abcd
The requirements:
- Check if the URL start with "www.ex...
Kevin_Stewart
Sep 11, 2012Employee
Certainly not the only option, but the following should work:
set hosturi [string tolower [HTTP::host][HTTP::uri]]
if { $hosturi starts_with "www.example.com/xyz/xyz.do?asar=equal?x=" } {
set firstpart [string range $hosturi 0 [expr [string first "?x=" $hosturi] + 2]]
set secondpart [string rang $hosturi [expr [string first "?x=" $hosturi] + 3] end]
log local0. [string map {"?x" "&x"} $firstpart][b64encode $secondpart]
}
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