Forum Discussion
Jamshid_40364
Nimbostratus
Jun 02, 2010Rule to automatically "follow" an internal redirect?
Hi, I'm new to iRules. I see the example of detecting a redirect and rewriting the Location header:
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/220/Rewriti...
Michael_Yates
Nimbostratus
Jun 03, 2010Here is an example to capture a 301 and 302 and redirect them.
First one is to redirect to a different website.
Second one is to redirect back to the base page. You could also redirect them to a pretty error page, etc.
when HTTP_RESPONSE {
if { [HTTP::status] == "301" } {
HTTP::redirect "http://www.website.com/"
}
elseif { [HTTP::status] == "302" } {
HTTP::redirect "http://[HTTP::host]/index.html"
}
}
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