Forum Discussion
Robert_47833
Sep 26, 2011Altostratus
Hi,how to set domain in this situation
Dear irule
in one irule,there are 2 types request https://1.cjj.com/aaaa https://1.cjj.co.uk/aaaa
I want to redirect them to my.1.cjj.com or .co.uk
elseif {$uri star...
Michael_Yates
Sep 26, 2011Nimbostratus
Hi jucao,
I would suggest not using the domain command in this situation since you have one two different levels that you are looking for. I think in this situation just using the ends_with comparison would be more efficient.
Let me know if this works for you.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/aaaa*" {
if { [HTTP::host] ends_with ".co.uk" } {
HTTP::redirect "https://my.1.cjj.co.uk"
}
elseif { [HTTP::host] ends_with ".com" } {
HTTP::redirect "https://my.1.cjj.com"
}
}
"/bbbb*" { HTTP::redirect "http://www.google.com" }
"/cccc*" { HTTP::redirect "http://www.yahoo.com" }
}
}
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