Forum Discussion

2 Replies

  • At first glance this should redirect correctly! [HTTP::uri] contains both [HTTP::path] and [HTTP::query] (the latter one which you seem to be missing in the redirect example). What is before the "elseif" and does the mobile server issue any redirects of it's own? Test with 'curl -IvkL '.
  • If 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?