Forum Discussion
jaddie_85451
Nimbostratus
Jun 26, 2014Redirect Loop
Hi all
New to iRules and I need help with a redirect here is what I would like to do (11.2.4 HF10)
User goes to existing site www.aaa.com
The user is redirected and presented with an informati...
Kevin_Stewart
Employee
Jun 26, 2014First iRule modified:
when HTTP_REQUEST {
if { ( [HTTP::uri] equals "/default" ) and not ( [HTTP::cookie exists SITEA] ) } {
HTTP::respond 302 Location "http://[HTTP::host]/default" "Set-Cookie" "SITEA=1;path=/"
} elseif { not ( [HTTP::cookie exists SITEA] ) } {
HTTP::respond 302 Location "http://www.bbb.com/communication"
}
}
And no, you no longer need to modify the HTML link with a query string. So the above basically says:
- if the request to site A is for "/default" and the SITEA cookie doesn't exist, redirect to itself and set the SITEA cookie (presumably this request is coming from site B).
- Else if the request is not for "/default" and the SITEA cookie doesn't exist, redirect to site B.
- And by default, if the request is not for "/default" and the SITEA cookie exists, do nothing (pass the traffic through to site A).
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