Forum Discussion
hooleylist
Sep 16, 2008Cirrostratus
Hi darraghk,
The concept of the rule snippet you listed wouldn't work as the HTTP::host and HTTP::uri commands won't return values in in the serverside context (like HTTP_RESPONSE). And if it did, you'd be redirecting the client to https for the same host and URI they just requested, not where the application is directing them for the next request.
Does the app send references to https in the Location header of redirects or within the payload? If it's in redirects, you should be able to use the rewrite redirects option on the HTTP profile. Or if you need to add more logic than the default config options you could use an iRule that looks for HTTP::is_redirect and checks/modifies the Location header. If it's references to https in the response payload, you could use a stream profile and iRule to modify it.
For more info on the HTTP profile option for rewriting redirects, try searching askF5.com for 'rewrite redirects'. For info on using an iRule to rewrite redirects, check the iRule Codeshare. And for examples of using a stream profile to rewrite response content, check the iRule wiki page for STREAM::expression.
Aaron