Forum Discussion
LyonsG_85618
Cirrostratus
Jul 31, 2013HTTP::header replace problem
Hi folks.
I have a simple iRule to replace a host & uri
when HTTP_REQUEST {
set requestedHost [string tolower [HTTP::host]]
set requestedURI [HTTP::uri]
...
LyonsG_85618
Cirrostratus
Aug 09, 2013I think this is the relevant part of irule
And looking at it now i guess it makes sense....the re-write from http://www.test1.com to https://www.test1.com/secure is picked up by this irule that knows /secure is HTTPS so it then does a redirect
( HTTP::respond 301 noserver Location "https://$requestedHost$requestedURI")
I'll need to figure out how to prevent this happening (perhaps a check to see whether referer = www.test1.com?)
REDIRECT HTTP to HTTPS
Check if URI is listed as requiring to be https and redirect is appropriate
} elseif {($protocol equals "HTTP") and ([class match -value $requestedURI starts_with $portalContextRoutingClass] equals "https")} {
set codeBlock "REDIRECT HTTP to HTTPS"
if {$debug >= 1} {
log local0. "$vsName : Debug Level $debug : $codeBlock : Redirecting to https://$requestedHost$requestedURI"
}
HTTP::respond 301 noserver Location "https://$requestedHost$requestedURI"
REDIRECT HTTP to HTTPS
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
