Forum Discussion

2 Replies

  • Please try this. hope it will work.

                when HTTP_REQUEST {
                set uri [string tolower [HTTP::path]]
                switch -glob $uri {
                 "/in" {
                 HTTP::redirect "http://New_http_URL_1"  }
                "/us" {
                HTTP::redirect "http://New_http_URL_2"   }
               "/uk" {
                HTTP::redirect "http://New_http_URL_3"   }
                "/sg" {
                HTTP::redirect "http://New_http_URL_4"   }  
                     }
                }
    
  • If I may add.

    The -glob option gives you the opportunity to use wildcard matches. So assuming "/in/" is just the start of the URI:

    when HTTP_REQUEST {
        switch -glob [string tolower [HTTP::path]] {
            "/in/*" {
                HTTP::redirect "http://New_http_URL_1"  
            }
            "/us/*" {
                HTTP::redirect "http://New_http_URL_2"   
            }
            "/uk/*" {
                HTTP::redirect "http://New_http_URL_3"   
            }
            "/sg/*" {
                HTTP::redirect "http://New_http_URL_4"   
            }  
        }
    }