Forum Discussion
http redirect to https based on http::uri
That is because you are not checking to see if you are already HTTPS. You need to check to see if you are https or not. Something like:
when CLIENT_ACCEPTED { Check for SSL if {[TCP::local_port] eq 443 } {set SSL 1} else {set SSL 0} }
when HTTP_REQUEST { if { !$SSL } { if { [HTTP::uri] starts_with "/login.aspx" or [HTTP::uri] starts_with "/Dashboard.aspx" } { HTTP::redirect https://[HTTP::host][HTTP::uri] ; return } else { use pool POOL_HTTP ; log local0. "https-redirect [IP::client_addr] [HTTP::host]" } } }
when HTTP_REQUEST { if { !$SSL } { if ([HTTP::uri] starts_with "/login.aspx") or ([HTTP::uri] starts_with "/Dashboard.aspx") } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } elseif { use pool POOL_HTTP log local0. "https-redirect [IP::client_addr] [HTTP::host]" } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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