Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

iRule to rewrite url in server response to client

I have a simple VS with 1 pool member, when the user goes to the URL (https://myurl.com) they are redirected to the full path (https://myurl.com/uri/login.jsp) just fine and are presented with a login prompt. After the enter their credentials and click the login button the server replies with the FQDN of the server (https://server01.local.domain/uri/redirectToLogin.jsp).

I have tried to modify the following irule to try to fit my need and while it does change the URL from the server name to the correct URL it does not work.

Original iRule: Image Text

Modified iRule: Image Text

So then i found another simpler (seemed) but this ones did not change the URL at all Image Text

Can anyone tell me what i am doing wrong or suggest a better way of doing this?

On a normal day i would tell them to change the server response (because i can see on my capture the server is sending the re-direct) but we are on a tight deadline and i need to find a workaround before Friday.

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

It might be quicker to just fix the backend, actually.

The shorter irule does not make sense, as "Host:" is a request header.

Any details as to how it does not work?

0
Comments on this Answer
Comment made 17-Apr-2018 by Jose Cruz 1

The URL does not change from server1.local.domain/uri to myurl.com/uri

0
Comment made 17-Apr-2018 by Jie 2761

You can capture the server response from your browser by going "Tools" -> "Web Developer" -> "network" to see what is sent back to the browser.

Your irule only fixes HTTP redirects sent by the backend.

0
Comment made 18-Apr-2018 by Jose Cruz 1

Issue is resolved... had to get mgmt involved but admin changed backend and issue is now resolved.

Just as an FYI the short iRule did change the URL from server1.local.domain/uri to myurl.com/uri, the reason it didn't work the first time i tried was because i had an extra character on mine so it wasn't matching. After i fixed it it worked but the site was not reachable due to the CF with the server config. Once the admin fixed the config the site worked and the iRule was not needed.

0