Forum Discussion
Pete_Paiva_7147
Nimbostratus
Apr 27, 2017iRule redirect based on 403 or 404 response
Hello,
I'm looking for some assistance creating an iRule that will do the following:
If you go to:
http://projects.mysite.com/sites/alp-socialmedia
and you get either a 403 or 40...
Stanislas_Piro2
Cumulonimbus
Apr 27, 2017Hi,
you can try this irule... and modify it to support all your hostnames.
when HTTP_REQUEST {
if {[HTTP::host] equals "projects.mysite.com" && [HTTP::uri] equals "/sites/alp-socialmedia"} {
set redirect_available 1
} else {
set redirect_available 0
}
}
when HTTP_RESPONSE {
if { $redirect_available && (([HTTP::status] eq "403") || ([HTTP::status] eq "404")) } {
HTTP::respond 302 Location "https://collaboration.mysite.com/sites/alp-socialmedia"
}
}
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