Forum Discussion
M0_185239
Nimbostratus
Mar 03, 2016irule to redirect url
at the moment we have this irule
elseif { ([string tolower [HTTP::uri]] starts_with "/test") } {
HTTP::redirect "http://m.domain.com[HTTP::uri]"
So what it does is this:
if a user goes here...
Andy_McGrath
Cumulonimbus
Mar 03, 2016If your www.domain.com and m.domain.com hit the same Virtual Server you will always trigger this iRule as the 'uri' after the redirect will still start with '/test' and create a redirect loop on the client. Try the following simplified iRule:
when HTTP_REQUEST {
if{([string tolower {HTTP::host] eq "www.domain.com") && ([string tolower [HTTP::uri]] starts_with "/test")}{
HTTP::redirect "http://m.domain.com[HTTP::uri]"
}
}
Also is looks to only be part of the iRule, can you post the full iRule so get a better view of what is happening?
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
