Tyler_Jason_985
Aug 02, 2006Nimbostratus
Redirect HTTP to HTTPS Based upon URL
Hello all,
I am new to iRules, BigIP and the like so I apologize in advance.
I have a situation where I need to redirect HTTPs to HTTP when a url does not start with 'abc.xyz.com'.
Background: In order for our application to work, we must set the BigIP's rewrite parameter to 'ALL'. By doing so, all urls redirect to https. This is due to a known defect between IBM's WebSphere App Server - webserver plugin and BigIP (IBM Reference 1116533 - Compatibility problems with hardware secure socket layers accelerators and the WebSphere Application Server Web server plugin).
However, there are some URLs in our application that should not be redirected to HTTPS. If there wasn't a conflict between IBM WAS and BigIP, we could set the rewrite parameter to 'Matching' and our problem would be resolved.
So, since we have to set the rewrite to 'All', will an iRule do the trick to resolve my issue? Will the iRules fire after the rewrite parameter fires?
Based upon the forums and the reference material, I put together an iRule. Am I on the right track?
when HTTP_REQUEST {
if the uri does not contain "abc.xyz.com", then redirect
to the HTTP version
if { ! [matchclass [HTTP::uri] contains "abc.xyz.com"] }
{ HTTP::redirect "http://[HTTP::host][HTTP::uri]" }}
Thank you in advance!