Forum Discussion

PSFletchTheTek's avatar
Apr 11, 2022
Solved

LTM Local traffic policy to many options!!! - Help needed!

Hi All,

I've got a bit lost in how to do this, one of our app teams have a issue with a bought in peice of software that has hard coded the incorrect links to its css file and a image. There asking me to see if i can get the f5 to amend the page if it sees the certain lines to the correct ones. 

So this is looking at the header / body of the page, i know i can use HTTP "something" in the LTP Match but its just which one, i can't find much documentation or examlpes on these bits with a idea of how to use it or i might even be wrong!

So i have something like 

 

 

<head>
  <link rel="stylesheet" href="https://mywebsite.com/styles.css">
</head>

 

 

That i need to change to

 

 

<head>
  <link rel="stylesheet" href="https://mywebsite.com/artifacts/styles.css">
</head>

 

 

There is also a png linked to this in other paces that has the same issue, its coded to the base route but they need it redirecting to a folder on the same path.

Can anyone point me in the right direction please?

Thanks

Pete

  • Hi PSFletchTheTek ,

    Yes there are various options available under LTM policy and you need to choose specific based on the different use cases. In your case, you can choose HTTP host and HTTP URI to match the condition and once it is matched, you can use REDIRECT to change the location.

    I have given one of the sample LTM policy specific to the details given in your post. You may need to customize it based on other use cases if any. You can also match multiple hosts as well as multiple URIs or any combination and do the same redirection for all the matched traffic.

     

    Hope it helps!

4 Replies

  • Hi PSFletchTheTek ,

    Yes there are various options available under LTM policy and you need to choose specific based on the different use cases. In your case, you can choose HTTP host and HTTP URI to match the condition and once it is matched, you can use REDIRECT to change the location.

    I have given one of the sample LTM policy specific to the details given in your post. You may need to customize it based on other use cases if any. You can also match multiple hosts as well as multiple URIs or any combination and do the same redirection for all the matched traffic.

     

    Hope it helps!

    • PSFletchTheTek's avatar
      PSFletchTheTek
      Icon for MVP rankMVP

      Wow, thanks for the help and the graphic! (It's really helped!
      Using the same HTTP Host and HTTP URI Match conditions, i've gone with a replace HTTP URL action.
      But it looks like its doing just what i need it to do on my lab test system!
      I've got to wait to get it into our production test system with change control!!!
      Out of interest, is there a way to rewrite the page on the responce so the correct link appears in the page?
      I think this can be done by a stream, but if i can capture its in a LTP it would much nicer with the other config for this site.  Thanks!!!

  • Thanks Mayur_Sutare, it worked brillantly in production.
    I'll look into the rewrite profile for me own interest, but the LTP fix is very light and worked perfectly and it looks like the app teams are promising me this won't clash with there other applications! (I've heard that before to many times!) thus the backup plan of the rewrite profile, but i know that's more overhead on the f5 and page load time!