Forum Discussion
jgoetsch_236444
Nimbostratus
Dec 10, 2015Getting Too Many Redirects error: What is wrong with this iRule?
Hi All,
I wrote an iRule that is correctly redirecting a URL that was sent out by our marketing team that was not correct. The page URL is also case sensitive, and emails were sent out with variou...
Kai_Wilke
MVP
Dec 11, 2015Hi Jgoetsch,
It really depends on your own requirements? If the URI is just "/starter-kit" without any additional deep-links, then "equals" would be fine.
If "/starter-kit" has additional deep-links (e.g. /starter-kit/test?abc=1), that must be formated to lowercase too, then you may want to try this code.
when HTTP_REQUEST {
set low_path [string tolower [HTTP::path]]
if { $low_path starts_with "/starter-kit" } then {
HTTP::path $low_path
} elseif { $low_path contains "solutions/starter-kit" } then {
HTTP::redirect "https://www.bittitan.com/starter-kit"
}
}
Remark: Using [string tolower [HTTP::path]] to avoid reformating of potential query (e.g. ?abc=1 ) strings.
Cheers, Kai
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