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
Cirrus
Aug 26, 2014when HTTP_REQUEST {
if {[HTTP::host] equals "awww.abc.com"}
{
HTTP::redirect "http://aportal.abc.com[HTTP::uri]"
log local0. "[HTTP::host] - client ip : [IP::client_addr] - Redirect to http://aportal.abc.com[HTTP::uri]"
}
if { [HTTP::host] equals "asites.abc.com" and [HTTP::uri] starts_with "/bseu/finance" } {
log local0. "[HTTP::host] - client ip : [IP::client_addr] - Before URI : [HTTP::uri], Redirect to http://asites.abc.com/sites/finance"
HTTP::redirect "http://asites.abc.com/sites/finance"
}
}
ShakN_167332
Nimbostratus
Aug 28, 2014i code one more code
log local0. "Incoming URI = [HTTP::uri]"
if { [string tolower [HTTP::uri]] starts_with "/bseu" } {
set uri [string map -nocase {"/bseu" "/sites"} [HTTP::uri]]
log local0. "New URI = $uri"
HTTP::uri $uri
}
}
now client requirement changed, above code is working where it is redirecting all the sites to required uri but client wants 2 sites which is /bseu and /bseu/it should not redirect according to the code. please suggest how this can be achived.
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