Forum Discussion
nrelihan_68143
Jul 08, 2011Nimbostratus
Redirecting 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
Jul 08, 2011Nimbostratus
Hey Peter, thanks for your response. Your correct, in your response to my last question. I did'nt think it through correctly.
So here is my code that I think should work, I need to test it first.
One more thing do I need quotes around this? http://www.fakewebsite.com/ireland/[HTTP::uri]
IRELAND POOL
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "http://www.fakewebsite.com" \
and [string tolower [HTTP::uri]] starts_with "/ireland"} {
HTTP::respond 302 Location http://www.fakewebsite.com/[HTTP::uri]
} else {
HTTP::respond 302 Location http://www.fakewebsite.com/ireland/[HTTP::uri]
}
}
UK POOL
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "http://www.fakewebsite.com" \
and [string tolower [HTTP::uri]] starts_with "/ireland"} {
HTTP::respond 302 Location http://www.fakewebsite.com/[HTTP::uri]
} else {
HTTP::respond 302 Location http://www.fakewebsite.co.uk/[HTTP::uri]
}
}
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