Bob_10976
Sep 08, 2010Nimbostratus
Append 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 the it includes the realm for these users.It should look something like this: https://mydomain.com/Pages/SiteSpla...tion:Realm. The trick is that "?whr=urn:federation:Realm" needs to append to any and all URLs, so in case someone sends another person a link via email to go to the link https://mydomain.com/bob/home.aspx that the "?whr=urn:federation:Realm" is appended to that as well. Also since its' possible that some URLs will contain a "?" already then we have to account for that because, from my understanding, you can't have two "?" in the URI.
Also I was wondering is it possible that the "?whr=urn:federation:Realm" be added but not show up in the Browser, keeping the user's URL window clean of this appeand or rewrite?
Working with one of my dev folks we came up with this, which doesn't seem to work but I'm not sure where our issue is. If anyone has any suggestion or thoughts please let me know.
when HTTP_REQUEST {
switch "[string tolower [HTTP::host]]" {
"mydomain.com" {
if {not [string tolower [HTTP::uri]] contains "whr=urn:federation:Realm"}{
if {[string tolower [HTTP::uri]] contains "?"}{
HTTP::uri [append [HTTP::uri] "&whr=urn:federation:Realm"]
}
{
HTTP::uri [append [HTTP::uri] "?whr=urn:federation:Realm"]
} } } } }
Thanks in advance..
Bob