Forum Discussion
JosephT
Nimbostratus
Jun 13, 2008iRule redirect help
I have an irule that redirects all traffic to https:
rule https.redirect.irule {
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
} ...
hoolio
Cirrostratus
Jun 16, 2008When testing with the VIP on port 8004, does the client make requests with the port number in the Host header? If so, you could remove it using the Codeshare example:
http://devcentral.f5.com/Wiki/default.aspx/iRules/HTTPToHTTPSRedirect_302.html
when HTTP_REQUEST {
Check if Host header value has a length
if {[string length [HTTP::host]]}{
Redirect to the requested host and URI (minus the port if specified)
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
} else {
Redirect to VIP's IP address
HTTP::redirect https://[IP::local_addr][HTTP::uri]
}
}
Aaron
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
