Forum Discussion
kmtmt_51646
Nimbostratus
Apr 17, 2012change http:/ links to https:/ except a certain URL
Hi all,
Servers have HTML links with a href tag with "http:" so I use stream iRules to change them to "https:" but now I need to not change it for a certain URL.
I'd like to do:
1) check server re...
hoolio
Cirrostratus
Apr 17, 2012I like that idea of finding/replacing the same string to avoid the replacement Nitass. Here's another option using a lookaround regex:
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace any http:// instance with https://, unless the original string is http://www.no-change.com
STREAM::expression {@http:(?!//www\.no-change\.com)@https://@}
Enable the stream filter for this response only
STREAM::enable
}
}
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