Forum Discussion
Misty_Spillers
Sep 29, 2011Nimbostratus
Https on a http site with stylesheets
Sorry I have searched and there seems like many similar questions but I can't find the one that fixes my issue. I'm far from an expert so sorry if this is newbie but I'm out of time to fix the issue ...
Michael_Yates
Sep 30, 2011Nimbostratus
Hi Misty,
One of the examples posted on the STREAM::expression Wiki page is probably what you are going to want to look into using:
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://example.com
STREAM::expression {@http:(?!//example\.com)@https://@}
Enable the stream filter for this response only
STREAM::enable
}
}
The previous iRule will replace any http:// instance with https://, unless the original string is http://example.com.
The special characters are Regular Expressions.
() encapsulates the expression.
?! is a negative look ahead or don't replace this.
// is part of the lookup.
the \. is an escape character noting that the period is part of the literal compare.
So if you add in your exception you should be good to go.
There is a nice Regular Expression Cheat sheet here: http://www.addedbytes.com/download/regular-expressions-cheat-sheet-v2/pdf/
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