Forum Discussion
iRule to URL rewrite
Hey All,
I've tried searching for a solution to this but nothing has come up. Probably because I am not sure the correct search query to put in. If this is answered already I apologize for the repeat.
I have an appliance that offers a web portal - lets call it portal.company.com. In this web portal there is a link to an external page: lets say www.google.com for argument sake. This is a simple HTML A HREF link.
I don't have the access / ability to edit the HTML code to point the link to my internal page work.company.com due to the way the appliance works.
The portal.company.com is using an F5 LTM virtual server. I'd like to know if there is an irule that can recognize that the user clicked this link and take the user to work.company.com instead of www.google.com
I hope the above makes sense. Please let me know if you need any clarification. I appreciate your help.
1 Reply
- Kevin_Stewart
Employee
I guess the answer depends on what the portal is. Is this an APM portal or are you load balancing another portal product with an LTM?
If the latter, once that URL gets to the client it's too late. So you're best option is to use an iRule to catch the responses from the portal and rewrite the www.google.com links. I'd probably use an empty STREAM profile and STREAM iRule. It might look something like this:
when HTTP_REQUEST { HTTP::header remove Accept-Encoding STREAM::disable } when HTTP_RESPONSE { if { [HTTP::header Content-Type] contains "text" } { STREAM::expression {@www.google.com@www.company.com@} STREAM::enable } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com