Forum Discussion
hkatzler_36651
Nimbostratus
Jul 23, 2009http redirect with using different pools
Hello,
i need an iRule to redirect http requests. I have to use different pools for diffrent redirects.
Sample:
http://keyaccount.company.com should redirect to http://keyaccount.othe...
hoolio
Cirrostratus
Jul 23, 2009Hi Heiko,
I think you want to rewrite the host and/or URI not redirect the client to a new location. Here is an example to get you started:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"keyaccount.company.com" {
Rewrite / to /path/path/index.html
if {[HTTP::path] eq "/"}{
HTTP::uri "/path/path/index.html"
}
Rewrite host header to keyaccount.othercompany.com
HTTP::header replace Host "keyaccount.othercompany.com"
Use pool1
pool pool1
}
"keyaccount.company.com" {
Rewrite / to /path/path/index.html
if {[HTTP::path] eq "/"}{
HTTP::uri "/path/path/index.html"
}
Rewrite host header to keyaccount.othercompany.com
HTTP::header replace Host "keyaccount.othercompany.com"
Use pool1
pool pool1
}
default {
Take some default action for other host header values?
}
}
}
Aaron
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
