Forum Discussion
Bob_10976
Nimbostratus
Sep 08, 2010Append to or Rewrite URI
Hello all...
We have launched ADFS in our network and we'd like to setup an iRule so that when a user goes to the website, mydomain.com, that an iRule either appends or rewrites the URI so that th...
Bob_10976
Nimbostratus
Sep 23, 2010Aaron...
Thanks for the feedback. My dev ended up coming up with the below code. It seems to work and figured I'd post it in case anyone can benifit from it. I'm not a coder by any means so if theres a better way to do what we did, feel free to comment.
when HTTP_REQUEST {
switch "[string tolower [HTTP::host]]" {
"domainname.com" {
set lowerUri [string tolower [HTTP::uri]]
if {$lowerUri contains "whr=urn:federation:Realm"}{
set hasWHR 1
}
{
set hasWHR 0
}
if {!$hasWHR}
{
set newURI [HTTP::uri]
if {[string tolower [HTTP::uri]] contains "?"}
{
append newURI "&whr=urn:federation:Realm"
}
{
append newURI "?whr=urn:federation:Realm"
}
HTTP::uri $newURI
}
}
}
}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
