Forum Discussion
muzammil_88686
Aug 15, 2011Nimbostratus
Redirection to another pool
Dear Dev Team,
We have two Virtual Servers as below.
Virtual Server1:
---------------
Virtual Server Name: VS1
Virtual Server IP: 10.1.1.1
Pool Name: PL1
Nodes: 192.168.1.1 and 192.168.1.2
URL: www.xyz.com.us
Virtual Server2:
---------------
Virtual Server Name: VS2
Virtual Server IP: 10.1.1.2
Pool Name: PL2
Nodes: 192.168.1.3 and 192.168.1.4
URL: abc.xyz.com.us
I would like to redirect the URL: www.xyz.com.us/test123 to pool PL2 Servers as www.xyz.com.us/test123/test.html. I m using the iRule as below.
when HTTP_REQUEST priority 10 {
Check requested content on the header
if {[HTTP::uri] contains "test123"}{
log local0. "test123 detected"
HTTP Redirection
HTTP::redirect http://www.xyz.com.us/test123/test.html
Send to the new pool
pool PL2
}
}
It seems this is not working properly. When first time user tries he is getting the page but when he refreshes it is not working properly. Sometimes it is not working at all.
Could you pls help me out on this?
Appriciate your help!
- Michael_YatesNimbostratusHi muzammil,
when HTTP_REQUEST priority 10 { Check requested content on the header if {[string tolower [HTTP::uri]] starts_with "/test123"}{ Set new HTTP::uri HTTP::uri "/test123/test.html" Send to the new pool pool PL2 } }
- muzammil_88686Nimbostratus
- Michael_YatesNimbostratusHi muzammil,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test123*" { pool PL2 } } }
- Colin_Walker_12Historic F5 AccountYou could also do something like:
when HTTP_REQUEST { if {([HTTP::path] starts with "/test123") && !([HTTP::uri] ne "/test123/test.html") } { HTTP::uri "test123/test.html" pool PL2 } }
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