Forum Discussion

Amit585731's avatar
Amit585731
Icon for Nimbostratus rankNimbostratus
Mar 14, 2015

Can we redirect long url to diff short url

Hi,

 

I have a problem where we are redirecting all the traffic coming to abc.com (this is single sign on server) should be directed to xyz.com.. is it possible to redirect traffic coming on to xyz.com? or this is something done at server level?

 

Thanks

 

1 Reply

  • You can do redirects through iRules or Local Traffic Policies.

    You can check host name and uri and then redirect if it matches your condition... Something like

    when HTTP_REQUEST {
        if {[string tolower [HTTP::host]] equals "abc.com" && [string tolower [HTTP::uri]] equals "/pkmslogin.html?xyz.com"} {
            HTTP::redirect "https://xyz.com" 
            return
             If you wanted to use the param after the "?", you could do this instead:
             HTTP::redirect "https://[HTTP::query]"
        }
    }