Forum Discussion
vbhagat_122571
Nimbostratus
Sep 06, 2013iRule to replace http with https for specific URLs
All,
I am pretty new to F5s and am trying to get a iRule together to replace some of the URLs.
For example:
Replace http://user.example.net/images with https://user.example.net/images
...
Kevin_Stewart
Employee
Sep 06, 2013I just tested your iRule on an 11.x box and it looks okay. Minor cosmetic modification:
when HTTP_REQUEST {
STREAM::disable
}
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] contains "text" }{
set find_url1 "http://user.example.net/images"
set replace_url1 "https://user.example.net/images"
set find_url2 "http://user.example.net/port"
set replace_url2 "https://user.example.net/port"
STREAM::expression "@$find_url1@$replace_url1@ @$find_url2@$replace_url2@"
STREAM::enable
}
}
It changed all references to "http://user.example.net/images" and "http://user.example.net/port" to HTTPS URLs.
And the "/jwp" URL is embedded in the same page and will also be accessible via the same VIP
I don't believe this is true though. An http:// URL will not pass through a 443 VIP.
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