Forum Discussion
Joe_Pipitone
May 12, 2014Nimbostratus
Portion of iRule not being processed
I have combined multiple iRules into one, however the 2nd portion of the rule is not working. I have confirmed using logging that the URI is being caught, however redirection is not taking place. I...
Joe_Pipitone
May 27, 2014Nimbostratus
I'm coming back to this after a few days - it appears as though the query is not being changed to lowercase, and doesn't process unless I manually change the TID, FID, or C to lower case. Then, the redirect happens properly.
Here is the iRule in its current state:
Check the Host header value, set to lowercase
switch -glob [string tolower [HTTP::host]] {
"oldforum.olddomain.com" {
Check the URI, set to lowercase
switch -glob [string tolower [HTTP::query]] {
"tid=*" {
log local0. "Query is [HTTP::query]"
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=posts&t=[URI::query [HTTP::uri] tid]"
return
}
"fid=*" {
log local0. "Query is [HTTP::query]"
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=topics&f=[URI::query [HTTP::uri] fid]"
return
}
"c=*" {
log local0. "Query is [HTTP::query]"
HTTP::redirect "http://newforum.newdomain.com/default.aspx?g=forum&c=[URI::query [HTTP::uri] c]"
return
}
}
}
- Cory_50405May 27, 2014NoctilucentThis iRule won't change the query string to lower case, it only compares a lower case version of the query string in order to match against. In your log statements, you should see the original query specified (with capital letters if that's how it was originally requested). Or are you saying that it's no longer even logging/getting into the individual match statements within the switch?
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