Forum Discussion
Holck_4564
Nimbostratus
Nov 16, 2007iRule to change content in text/html
Hello,
Im looking for a sort of solution to rewrite contents in files matching text/html..
The files transferred via the loadbalancer contains data where I need to modify
the content.
If a file is transferred and matches "src=/folder/..." and "href=/folder/..." I want to make the /folder with an absolute url including /folder/.
From ...src="/folder/hello.jpg" to ...src="https://www.domain.com/folder/hello.jpg"
Is this a simple task?
// A
1 Reply
- hoolio
Cirrostratus
Hi,
If you want to rewrite a specific string like 'src="/' to 'src="https://www.domain.com/', in the HTTP data of every request and response, you could use a stream profile (Click here).
If you want more control over when the replacement is performed, you can add a blank stream profile to the virtual server and then use an iRule to specify the find/replace strings and the context (request and/or response) the replacement is done in.
The STREAM::expression wiki page (Click here) has a few examples.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
