Forum Discussion
I want to Redirect multiple Sites in a single Irule. please help me with the irule command.
Thank you that was really helpful. I need more help.
in our setup we have sites which are accessed by internal users as well as internet users via http and https. so we have created 4 VS (2 internal VS, one for http and one for https for internal users) and (2 for internet users 1 for http and one for https). our requirement is any lan user access sites via http than it should be http if lan users type https than it should redirect to http. similarly if any internet users access sites via http than it should redirect to https. this is done by 1 irule one for http to https redirection.
when RULE_INIT { set static::bsint "internet.abc.com" set static::sitesint "sites.internet.abc.com"
} 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]] { "sites.abc.com" { HTTP::header replace Host $static::sitesint STREAM::disable } "abc.com" { HTTP::header replace Host $static::bsint STREAM::disable } }
} } when HTTP_RESPONSE { if {[HTTP::is_redirect] && [string tolower [HTTP::header "Location"]] contains $static::sitesint}{ HTTP::header replace Location [string map "$static::sitesint $static::sitesext" [HTTP::header Location]] } elseif {[HTTP::is_redirect] && [string tolower [HTTP::header "Location"]] contains $static::bsint}{ HTTP::header replace Location [string map "$static::bsint $static::bsext" [HTTP::header Location]]
}
in addition to it i need to redirect below redirection in same irule please guide me how to do this.
if any one access from internet to the below url than it should redirect to https://asites.abc.com/xyz/finance
redirection to below url
http://asites.internet.abc.com/sites/finance
and many more sites like this.
please some one help me in this.thank you in advance.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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