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...
Peter_72728
Jul 08, 2011Nimbostratus
This looks like it would allow a redirect loop. Why do you need to do anything in this case? The domain is already correct and the "/ireland" context already exists.
if { [string tolower [HTTP::host]] equals "www.fakewebsite.com" and [string tolower [HTTP::uri]] starts_with "/ireland"} {
HTTP::respond 302 Location http://www.fakewebsite.com/[HTTP::uri]
}
I think you only need the logic from the case where the "/ireland" is added....right?
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.fakewebsite.com" and not [string tolower [HTTP::uri]] starts_with "/ireland"} {
HTTP::respond 302 Location http://www.fakewebsite.com/ireland/[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