Forum Discussion

faizan123_23330's avatar
faizan123_23330
Icon for Nimbostratus rankNimbostratus
Jan 04, 2017

URL redirection

We have two domain i.e --> abc.com.pk --> xyz.com.pk Both of these domains resolved on single virtual server ip address that we have configured on our F5. we have also used SAN certificates for HTTPS traffic that is used for both domains. Now we want if the user opens abc.com.pk it should be redirected to xyz.com.pk and client will see xyz.com.pk in their browser. Kindly help me in resolving this if there is any i rule using for it ? kindly help me in that.

 

1 Reply

  • Would use a normal Host-based HTTP redirect iRule. Stream is needed when modifications in the payload are needed, but I see no clue it being the case here.

     

    when HTTP_REQUEST {
    
        if { [HTTP::host] eq "abc.com.pk" }{
            HTTP::respond 301 Location "https://abc.com.pk" Connection Close
            event disable
        }
    
    }

    If you want to retain original request path and parameters, then replace "; with "https://abc.com.pk[HTTP::uri]" in the code above.