Forum Discussion
smiley_dba_1116
Nimbostratus
Jun 28, 2010HTTP header redirect
V.10.2
Having a issue when trying to do a redirect. When a client types in www.xxx.com, we want the load balancer to look at the header, and auto redirect to www.yyy.com. Currently, I trie...
Chris_Miller
Altostratus
Jun 28, 2010Posted By smiley_dba on 06/28/2010 09:18 AM
V.10.2
Having a issue when trying to do a redirect. When a client types in www.xxx.com, we want the load balancer to look at the header, and auto redirect to www.yyy.com. Currently, I tried to use the following:
when HTTP_REQUEST {
if { ([HTTP::host] != "www.xxx.com") } {
HTTP::redirect "http://www.yyy.com"
}
}
I does not redirect at all. it just sits there. Any help is great appreciated. You're basically trying to do a host redirect. You've used the "!" character which basically = "not" so you're saying if your host doesn't equal "www.xxx.com" then redirect to www.yyy.com" Remove the "!" and see what happens.
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.xxx.com") } {
HTTP::redirect "http://www.yyy.com"
}
}
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