Forum Discussion

Audiolomb's avatar
Audiolomb
Icon for Nimbostratus rankNimbostratus
Nov 24, 2020

URL Rewrite / redirect?

Hello everyone,

I am a newbie on url rewriting so I need some help.

 

Here is the case I need to solve.

First off, some definitions.

 

  • load balancer URL that the customers will see: https://mytime.domain.com
  • Backend URL the load balancer will forward requests to: https://internalwebserver.domain.com/mytime

 

Here is what I need to be happening:

 

  • The customer will hit https://mytime.domain.com
  • the load balancer will forward this request to https://internalwebserver.domain.com/mytime
  • the customer will see the content BUT (and this is mandatory) he will see on the navigation bar just the URL https://mytime.domain.com

 

Basically we need to get rid of the /mytime uri on the customer side, but keep anything else that comes after it.

 

I hope this is clear enough.

 

Is it doable?

  • ecce's avatar
    ecce
    Icon for Cirrostratus rankCirrostratus

    You could probably use Stream profiles for that. It replaces a string with another string. See https://support.f5.com/csp/article/K39394712 . If you use HTTPS you need to decrypt the traffic (use clientssl profile) and also attach HTML profile so BIGIP understands HTML and can modify it. The built-in html profile works fine, just add it in the VS settings.

     

    Stream profiles in its simplest form: you just put in the original string and the replacement string in two fields, and attach that profile to the VS. You can however make more advanced settings as well, like multiple replacements in the same stream profile. Look under Local Traffic > Profiles > Other > Stream

     

    iRules will also solve your problem, but Stream profiles are probably easier.