Forum Discussion
Srinivas_Kandik
Nimbostratus
May 12, 2009URL Change when redirecting
I would like to switch the context of the url when redirecting, need help on how to write the iRule.
For all http://www.abc.com/app1/xyz/1.html requests i would like to redirect them to...
The_Bhattman
Nimbostratus
May 12, 2009For GET it would be something like
when HTTP_REQUEST {
if {([HTTP::host] eq "www.abc.com") && ([HTTP::uri] eq "/app1/xyz/1.html") } {
HTTP::redirect "[HTTP::host]/app2/xyz/1.html"
}
}
Posts are a bit tricky but I suppose you can store POST request in a variable and and insert it on the new request.
Here is a method that was posted by the resident geniuses here in the forums
http://devcentral.f5.com/weblogs/Joe/archive/2005/07/27/ModifyingUriWithoutRedirect.aspx
Hope this helps
CB
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