Forum Discussion
sysadmin_2015_2
Nimbostratus
Nov 19, 2015iRule - URL Redirect
Hello,
One of our sites has two virtual servers, one for port 80 and another for 443. The port 80 virtual server currently has a https redirect iRule attached sending all port 80 traffic to 44...
Brad_Parker
Cirrus
Nov 19, 2015Yes you can do this with one iRule. It could look something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/games*" {
HTTP::respond 301 noserver Location "https://[HTTP::host]/test1"
}
"/live*" {
HTTP::respond 301 noserver Location "https://[HTTP::host]/test2"
}
default {
return
}
}
}
Also, if you are using BigIP v11.4+ you can also consider using Local Traffic Policies to redirect traffic based on HTTP::path.
https://support.f5.com/kb/en-us/solutions/public/15000/000/sol15085.html
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