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 27, 2011Nimbostratus
Hi jucao,
Take a look at the domain command. I think that your values need to be corrected from 3 / 2 to 2 / 1.
http://devcentral.f5.com/wiki/iRules.domain.ashx
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ends_with ".co.uk" } {
set envdomain "[domain $host 2]"
}
elseif {[string tolower [HTTP::host]] ends_with ".com" } {
set envdomain "[domain $host 1]"
}
}
Everything else looks good. Let us know if you have any problems with it.
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