Forum Discussion

Alfred_41980's avatar
Alfred_41980
Icon for Nimbostratus rankNimbostratus
Apr 14, 2011

Can GTM be configured to redirect uri?

Can GTM be configured to redirect http requests based on uri? For instance, the uri with http://www.mycompany.com/abc/1234 will be redirected to 1.1.1.2 and http://www.mycompany.com/xyz/1234 will be redirected to 2.2.2.1. If not doable then what solutions are available to solve this issue.

 

 

  • Hi Alfred,

    A GTM WideIP only accepts DNS queries so it wouldn't be able to handle any HTTP requests or redirections. If you have a GTM+LTM combination license (or just an LTM license), you could define an LTM virtual server to inspect the URI and issue HTTP redirects. You can do that with an HTTP class or a simple iRule:

    Using an iRule:

    when HTTP_REQUEST {
    
       if {[string tolower [HTTP::uri]] eq "/redirect_me"}{
          HTTP::redirect "http://[HTTP::host]/new_uri"
       }
    }
    

    Or using an HTTP class:

    profile httpclass uri_redirect_httpclass {
       defaults from httpclass
       pool none
       redirect "http://[HTTP::host]/new_uri"
       paths "/redirect_me"
    }
    

    Aaron