Forum Discussion

Ahmad_03_151082's avatar
Ahmad_03_151082
Icon for Nimbostratus rankNimbostratus
Apr 27, 2016

redirect

Dears Hope some one can help me on my issue

I already have iRules for my domain

when HTTP_REQUEST { if { [HTTP::uri] equals "/"}

{

switch [string tolower [HTTP::host]] {

"www.x.com" { HTTP::uri "/wps/portal/y" }
"www.z.com" { HTTP::uri "/wps/portal/example" }\

} }

else { switch -glob [HTTP::path]

{ "/wps/portal/w*" {HTTP::redirect "http://www.xyz.com" }

"/wps/portal/q" {HTTP::redirect "http://xyz.com/r" }
    }
            }

           }

What I need to iRule to redirect

        **www.z.com/wps/portal  TO  www.z.com/wps/portal/example**

Appreciate you help

1 Reply

  • when HTTP_REQUEST {
        if { [HTTP:host] equals "www.z.com" and [HTTP::path] equals'/wps/portal' }{
            HTTP::redirect "http://www.z.com/wps/portal/example"
        }
        if { [HTTP::uri] equals "/"} {
            switch [string tolower [HTTP::host]] {
                "www.x.com" { HTTP::uri "/wps/portal/y" }
                "www.z.com" { HTTP::uri "/wps/portal/example" }
            } 
        } else { 
            switch -glob [HTTP::path] { 
                "/wps/portal/w*" { HTTP::redirect "http://www.xyz.com" }
                "/wps/portal/q" { HTTP::redirect "http://xyz.com/r" }
            }
        }
    }