Forum Discussion
ghost-rider_124
Nimbostratus
Apr 12, 2014IRULE for redirect request (http to https), append request and rewrite response (http to https)
Hello Experts
I want to write irule for below requirement. Please help me out
1- http://www.abc.com/ -> https://www.abc.com/test/login.aspx (http to https and append test/login.aspx to www....
JRahm
Admin
Apr 12, 2014For 1&2, you can use an httpclass (pre v11.4) or a policy (11.4+) to do that, no iRule necessary.
For 3, google would need to rewrite that ajax call, the request isn't coming to your domain. However, assuming it's your app that is inserting that, you can use a stream profile to rewrite that URL to ssl. You can try this (untested, check out and tune as necessary in lab environment)
when HTTP_RESPONSE {
STREAM::disable
set stream_expression "";
if { ( ([HTTP::header Content-Type] starts_with "text/html") && ([HTTP::status] == 200) } {
set stream_expression "@http://www.youtube.com@@"
}
if { "" ne $stream_expression } {
STREAM::expression $stream_expression
STREAM::enable
}
}
when STREAM_MATCHED {
if { [string tolower [STREAM::match]] eq “http://www.youtube.com” } {
STREAM::replace “https://www.youtube.com”
}
}
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