Forum Discussion
Scott_Wozny_894
Nimbostratus
Jun 13, 2012Find and replace hostname strings in http payload
Dear iRule gurus,
First and foremost, I apologize for the length of this post. I've done a bunch of work on my own to get to this point and I just want to be sure all the relevant details...
Hi Scott,
Nice work in getting that far. Here's an example which should do what you want in rewriting the internal hostname to an external hostname for response headers and content and the reverse for requests.
https://devcentral.f5.com/wiki/iRules.Proxy-Pass-Lite.ashx
Note that you can combine the two replacements in a string map command:
string map -nocase {internalservername.internaldomain.com:7004 rsa.tst.publicdomain.com internalservername.internaldomain.com rsa.tst.publicdomain.com} [HTTP::header value Location]]
And you can do this same using STREAM::expression:
https://devcentral.f5.com/wiki/iRules.stream__expression.ashx
STREAM::expression {@internalservername\.internaldomain\.com:7004@rsa.tst.publicdomain.com@ @internalservername\.internaldomain\.com@rsa.tst.publicdomain.com@}
or this might work too:
STREAM::expression {@internalservername\.internaldomain\.com(:7004)?@rsa.tst.publicdomain.com@}
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects