Forum Discussion
Daniel_104050
Aug 29, 2012Nimbostratus
Need more redirect help
Sorry for the elementary questions, but I am new to F5 and have been thrown to the wolves so to speak. I need to find out how/if this can be done and searches aren't showing me what I am looking for,...
nitass
Sep 02, 2012Employee
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[HTTP::host] eq "site"} {
switch [string tolower [HTTP::uri]] {
"/a" { HTTP::redirect "http://[HTTP::host]/sites/a" }
"/b" { HTTP::redirect "http://[HTTP::host]/sites/b" }
default {
do something
}
}
}
}
}
[root@ve10:Active] config curl -I http://172.28.19.79/a -H "Host: site"
HTTP/1.0 302 Found
Location: http://site/sites/a
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.79/b -H "Host: site"
HTTP/1.0 302 Found
Location: http://site/sites/b
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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