Forum Discussion

Kevhed's avatar
Kevhed
Icon for Nimbostratus rankNimbostratus
Oct 14, 2014

HTTPS redirect to a different external website

I'm relatively new to F5 so not sure if this can be done. What we would like to do on our F5 is accept requests for https://webmail.our-companya.com and have the F5 send back a redirect to the client to go to https://webmail.not-our-company.com/companya. So our users would browse to our company's webmail URL and our external F5 would then send/redirect the users to another URL hosted by another company. Is this even possible?

 

Thanks

 

5 Replies

  • that is quite easy, just a simple redirect irule, enough of them going around

    when HTTP_REQUEST {
        HTTP::redirect "https://www.def.123.com[HTTP::uri]"
    }
    

    apply this to the virtual for your company webmail

  • Dears, I have same requirement where I have to redirect four URL's to one URL Do I need to define pool in the iRule (my requirement not to define pool) how will URL's will go to outside do I need to define any forwarding VS

     

  • you don't have the same requirement, you have a different one. it is really wiser to start your own question then jump on another one.

     

    still it is quite simple in principle. it depends a bit if you have 4 hosts (so the part before / in something like http://host.domain.ext/uri or really only need to redirect 4 hosts + uri?

     

    if it is 4 hosts you have DNS point them all to the same virtual server on which you redirect to the one other hosts + uri with the iRule above.

     

    if it is hosts + uri then it depends on if you can redirect everything send to the hosts or need only send some of the uri. then you will need to do a switch or if statement in the iRule on [HTTP::uri].

     

    pools don't come into play with basic redirection. you take the http request and send it somewhere else.

     

    this should get you started, this isn't very complex, with some googling and browsing here you should be able to pull it off.

     

  • Here is an irule that should work. Just set a standard virtual server with an HTTP profile associated to it which is needed for the response to function:

    when HTTP_REQUEST {

            if { [string tolower [HTTP::host]] equals "server.fromsomewhere.com" } {
                        HTTP::respond 301 Location "https://goto.thisserver.com/thispage"
            }
    

    }

    • Ashish_Ram_Tak1's avatar
      Ashish_Ram_Tak1
      Icon for Nimbostratus rankNimbostratus
      Thank you for the support but my requirement is user will only see the server.fromsomewhere.com in their browser and not https://goto.thisserver.com/thispage. Could you please help on this.