Forum Discussion
fcicala_29180
Nimbostratus
Jan 14, 2010http to https redirect with exceptions
Hello I am very new to iRules and just inherited a farm of 9.x F5.
I see that my predecessor is performing this task using the following iRule:
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] starts_with "text/" }{
STREAM::expression "@http:@https:@"
STREAM::enable
} else {
STREAM::disable
}
}
I read about it and if I get it right this rules replaces everything that has the word HTTP with HTTPS?
The actual requirement I was given a few days ago is to replace links that contain HTTP with HTTPS if the link contains a specific word in it.
Can this be somehow achieved?
- The_Bhattman
Nimbostratus
The same type of Irule can be applied. It all depends on what what you are looking to replace. IS the specific word part of a link? - fcicala_29180
Nimbostratus
Yes it is part of a link. - The_Bhattman
Nimbostratus
Then you should be able to do the followingwhen HTTP_RESPONSE { if { [HTTP::header Content-Type] starts_with "text/" }{ STREAM::expression "@http:\\somedomain.com\word@https:\\someotherdomain.com\word@" STREAM::enable } else { STREAM::disable } }
- hoolio
Cirrostratus
Hi, - The_Bhattman
Nimbostratus
It would be nice to get to update the post from within an email. - fcicala_29180
Nimbostratus
Thanks. I will test this.
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