Forum Discussion
Joe_Pipitone
Nimbostratus
Apr 13, 2010Big-ip syslog errors continue
After combining multiple redirect iRules into one master iRule, I'm still getting the following error in the big-ip logs.
I was under the impression that having separate iRules with redirect statem...
hoolio
Cirrostratus
Apr 21, 2010Hi Joe,
When you say the redirect doesn't pass on the query string, can you clarify what you mean? As long as the redirect includes the HTTP::query command, LTM should append the requested query string to the redirect.
If you wanted to add the HTTP::path check to the switch which uses HTTP::uri, you could use the lines below. It looks for a URI of exactly "/info.aspx" or "/info.asp?" followed by anything. Either match would result in a redirect to the URL below with the original query string appended.
switch -glob [string tolower [HTTP::uri]] {
...other checks...
"/info.aspx" -
"/info.aspx\?*" {
HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]"
}
}
Note that I've added the -glob flag to the switch so that wildcards can be used in the switch cases.
You can also add a default case to the main switch statement which will run if no prior match is found. In that default switch case, you can check for the legacy rewrite and 'strip www from host' code.
if {[HTTP::uri] starts_with "/admin" } {
HTTP::redirect "http://legacy.domain.com[HTTP::uri]"
} elseif {[string tolower [HTTP::host]] eq "www.domain.com"}{
HTTP::redirect "http://domain.com[HTTP::uri]"
}
Note that I've changed the 'strip www from domain' code slightly as both cases in your switch were doing the same thing.
Does this make sense and look like it would work for you?
Aaron
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