Forum Discussion
nrelihan_68143
Nimbostratus
Jul 08, 2011Redirecting to regional website depending on user DNS.
Hey all, I'm quite new to F5 irules first of all.
Perhaps I'll tell you what I have working first and then explain to you what additional things I'd like to do.
What I have working...
nrelihan_68143
Nimbostratus
Jul 11, 2011Thanks for the help last week guys, So I decided to put the rules into one, as it was mentioned above.
Have to yet test the code but could you have a quick browse and tell me if theres anything wrong with the syntax?
Thanks again!
when HTTP_REQUEST {
set hostname [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
switch -glob [whereis [IP::client_addr]] {
"IE" {
if {$hostname eq "www.quinn-direct.com" and not $uri starts_with "/ireland"} {
HTTP::redirect http://www.quinn-direct.com/ireland/[HTTP::uri]
pool gpool-qdi-ie-quinn-direct.com-ie
}
}
"GB" {
if {$hostname eq "www.quinn-direct.com" and not $uri starts_with "/ireland" } {
HTTP::redirect http://www.fakewebsite.co.uk/[HTTP::uri]
pool gpool-qdi-ie-quinn-direct.com-uk
}
}
Default { pool gpool-qdi-landing-cavan-http }
}
}
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