Forum Discussion
Andy_Bourke_497
Nimbostratus
Apr 20, 2009Multiple redirects on one VIP
Hi,
We have a virtual server that I've been configuring and I need to write an iRule for some specific functionality.
We have 10 regional sites that all point to one VIP....
hoolio
Cirrostratus
Apr 22, 2009If all of the domains resolve to the ViP that the iRule is configured on, you probably want to limit the iRule by checking the requested path first. If the path equals "/", then check the requested host header value. You can add this check to the top of the iRule:
when HTTP_REQUEST {
Log a debug line for every request
log local0. "[IP::client_addr]:[TCP::client_port]: New request to [HTTP::host][HTTP::uri]"
Check if requested path is /
if {[HTTP::path eq "/"}{
Redirect based on the host header value
switch [HTTP::host] {
"*1*" {
...
And you would need to remove the HTTP::redirect from the default case.
Aaron
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
