Forum Discussion
Steven_Ruby_872
Nimbostratus
Jan 13, 2006http url redirect
after searching through the forum and trying a couple of diff iterations of redirect iRules.
i need to redirect requests for http://server/dir to http://new.server/dir
currently i have the following which doesnt seem to work.
I HAVE FIGURED IT OUT, the following works
rule url_redirect
when HTTP_REQUEST {
if { [HTTP::uri] contains "wnidata2"} {
log local0. "URL is [HTTP::uri]"
HTTP::redirect "http://someurl[HTTP::uri]"
HTTP::redirect "http://www.google.com"
}
}
thanks
-sr
3 Replies
- Colin_Walker_12Historic F5 AccountWhen you say this doesn't work, what exactly do you mean? The rule appears to be correct. It's a pretty standard redirect rule that looks like:
when HTTP_REQUEST { if {[string tolower [HTTP::uri] ] contains "wnidata2"} { log local0. "URL is [HTTP::uri]" HTTP::redirect "http://fms.wni.com[HTTP::uri]" } }
-Colin - One possible thing that sticks out is if this iRule is configured on a virtual that is the address for "fms.wni.com" then this will cause an infinite loop.
- Steven_Ruby_872
Nimbostratus
JOe,
yeah i found that out the hard way, i just created a new pool with the "other" servers and pointed it at that.
thanks for the reply
sr
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
