Forum Discussion
ShakN_167332
Nimbostratus
Aug 20, 2014I want to Redirect multiple Sites in a single Irule. please help me with the irule command.
I have mulitple sites where i want my LAN users should not to redirected to https when they use url with http. but when any internet users use http://abc.com than it should redirect to https://abc.co...
Yann_Desmarest_
Nacreous
Aug 24, 2014Maybe you can try this
when HTTP_REQUEST {
if { [HTTP::host] equals "asites.abc.com" } {
switch -glob [HTTP::uri] {
"/xyz/finance" -
"/xyz/site2" -
"/xyz/site3" -
"/xyz/site4" -
"/xyz/site5" {
HTTP::redirect "http://asites.internet.abc.com[string map -nocase [list "/xyz/finance" "/sites/finance" "/xyz/test" "/sites/test"] [HTTP::uri]]"
}
default {}
}
}
You can also use datagroup to achieve what you want
when HTTP_REQUEST {
if { [HTTP::host] equals "asites.abc.com" } {
if { class match [HTTP::uri] equals mydatagroup } {
HTTP::redirect "http://asites.internet.abc.com[class lookup [HTTP::uri] mydatagroup]"
}
}
}
where datagroup of type string contains "/xyz/finance" with value "/sites/finance"
ShakN_167332
Nimbostratus
Aug 24, 2014Will this irule work for my internet traffic redirection from https to http.
when HTTP_REQUEST {
if {[class match [IP::client_addr] equals InternalHosts]}
{
HTTP::redirect http://[HTTP::host][HTTP::uri]
} else {
switch -glob -- [string tolower [HTTP::host]] {
"https://asites.abc.com/bseu/finance"
{
HTTP::redirect "http://asites.internet.abc.com/sites/finance"
}
}
}
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