Forum Discussion

K-Dubb's avatar
K-Dubb
Icon for Nimbostratus rankNimbostratus
Jan 19, 2012

Friendly URI Re-Write based off of User-Agent?

Hi everyone,

 

 

I was wondering if it is possible to do a URL Re-write based off the user-agent of the browser?

 

 

For instance, we have users that come in on url1.domain.com and are then redirected to url2.domain.com at the website level. The SSL cert is based off of url2.domain.com, and url2.domain.com is what the user sees in the browser.

 

 

We would like for a user that makes a request to any pool to always show the friendly url1.domain.com if their user-agent is of type Mozilla, or TestAgent. So in the browser the user would always see url1.domain.com with no SSL error, and on the back end they will still be redirected as usual.

 

 

Is this possible? How can it be done?

 

 

 

Thank you!

 

15 Replies

  • K-Dubb's avatar
    K-Dubb
    Icon for Nimbostratus rankNimbostratus
    I think this is something like what I am needing to do, only based off of the user-agent type instead.

     

     

    Taken from: http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1171749/showtab/groupforums/Default.aspx

     

     

    What I am looking to do is a redirect from something like www.abc123.com to www.abc456.com/application/. However, I want the browser bar only to show the www.abc123.com + URI. Any help with this would be greatly appreciated.

     

     

     

    That is the part I need, only based off of user-agent, and the F5 is not doing the redirecting. I have looked at proxy pass, but I am very new at iRules, and reading the instructions talks about specifying a pool in a data group which leads to me think that this is not what I want. We have all of the pools we need, and what the user to go to the same VIPs and Pools that they have been.
  • K-Dubb's avatar
    K-Dubb
    Icon for Nimbostratus rankNimbostratus
    So maybe a better way to put it is that we want to mask the URL that the client is redirected to on our back end, with the URL that they came in on.
  • I see what you're asking for now, and I don't personally think it is a wise solution to any problem. If the back end is going to do a redirection then something else clearly must use the redirection, and if it's not the UA, it's the LTM. So you really want a client to request domain1.com, the LTM pass that to the back end, the back end to 302 to domain2.com, the ltm to intercept this 302, follow it and then retry the incoming request again to an alternative pool.

     

     

    There are examples of this: http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1171749/showtab/groupforums/Default.aspx

     

    http://devcentral.f5.com/wiki/iRules.Redirect-Trapper.ashx

     

     

    But if I were being asked to implement this professionally I would rather push back very hard to make the application work differently in the first place, or shange the requirements.
  • K-Dubb's avatar
    K-Dubb
    Icon for Nimbostratus rankNimbostratus
    I agree. There does not seem to be a way to really do this a nway. Thank you very much for your help.
  • There may not be a way to achieve what you're after, but I wouldn't currently percieve this to be an LTM limitation, more an unrealistic / illogical goal, so if you do I'd suggest exploring further.