Forum Discussion
Dunleap_21354
Nimbostratus
Apr 10, 2008changing URI path
So I need to write a rule that will "see" the path /citrix/pnagent/confg.xml and replace it with /pnagent/config.xml removing the citrix part.
My first stab doesn't appear to be working, Any id...
hoolio
Cirrostratus
Apr 11, 2008The stream profile/filter only operates against the payload. So if you've added an HTTP profile to the VIP, and want to modify the path in the URI (part of the headers--not the payload), you should use nmenant's example of HTTP::path.
If you need to rewrite the request and/or response payload, I'd suggest adding a blank stream profile to the VIP and an iRule to configure the stream filter. Here is an example of replacing a string in the response content:
http://devcentral.f5.com/wiki/default.aspx/iRules/stream__expression
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace IE with Apache, Windows with Linux
STREAM::expression "@IE@Apache@ @Windows@Linux@"
Enable the stream filter for this response only
STREAM::enable
}
}You can find more information on the stream profile and related STREAM:: commands on AskF5 and the iRules wiki:
SOL8115: Overview of the Stream profile:
https://support.f5.com/kb/en-us/solutions/public/8000/100/sol8115.html?sr=636220
iRules STREAM wiki page:
http://devcentral.f5.com/wiki/default.aspx/iRules/stream
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
