Forum Discussion

owaters_69636's avatar
owaters_69636
Icon for Nimbostratus rankNimbostratus
Oct 17, 2009

Redirect uri & port

I am trying to redirect a uri that has a designated port as part of the uri.

 

 

Example

 

 

We would like to have this uri redirected from http://app.company.com:443 to http://newapp.company.com

 

 

 

This would redirect the app.company.com:443 to newapp.company.com

 

 

I am using the following redirect irule

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "app.company.com*"} {

 

HTTP::redirect "http://newapp.company.com"

 

}

 

}

 

 

It doesnt appear to be

 

redirecting as I expected. I'm new to iRules as well so I'm just looking for some guidance on this one.

 

  • I am assuming that the http://app.company.com:443 is going to a VIP listening on port 443, yes?

     

     

    if so then your iRule on that vip would work (I would remove the "*" from "app.company.com")

     

     

    CB

     

  • Sorry for the late response....I have tried to use this iRule but it doesnt redirect app.company.com:443 to newapp.company.com. What I am trying to do is find an iRule that will take a http://app.company.com:443 and redirect it to http://newapp.company.com. F5 instructed that I do use the"*" from app.company.com

     

     

    Any ideas?? I'm a Irule newbie so excuse me if I didnt disclose enough information here yet.

     

     

  • The following irule could work

      
     when HTTP_REQUEST {  
       if {[HTTP::host] eq "app.company.com" } {  
         http://redirect "http://newapp.company.com/"  
       }  
     }  
     

    This only works properly if you have a virtual server listening on 443 or ANY port and are terminating the SSL on the LTM. If you are using virtual server on 443 then I am assuming you have one listening on port 80 as well.

    I hope this helps

    CB