Forum Discussion
winnajeem_25540
Nimbostratus
Mar 23, 2016redirect loop
Hi All.
Request help to resolve redirect loop.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "abc.com"}
{
if { not ([HTTP::uri] contains "/abc/en")
or not ...
Kai_Wilke
MVP
Mar 23, 2016Hi Winnajeem,
the problem with your iRule is that "(not /) or not (/abc/en)" is alway true and therefor hits the redirect everytime.
To fix the redirect loop, you may try the iRule below...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "abc.com"} then {
if { ([string tolower [HTTP::uri]] starts_with "/abc/en") or ([HTTP::uri] equals "/") } then {
Do nothing
} else {
HTTP::redirect "http://[HTTP::host]"
}
}
}
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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