Forum Discussion
Jay_Prasanth_13
Nimbostratus
Dec 05, 2013How to force HTTPS on masked uri?
can anyone help me to force HTTPS on masked uri?
For eg :
if {[HTTP::uri] eq "/dd"
HTTP::uri "/xx/yyy/ddd"
Current outcome - http://mysite/dd , however HTTPS works if mention explicitly.
...
IheartF5_45022
Nacreous
Dec 19, 2013Hi Jay,
If what you want when a user enters http://xx.com/dd is for;-
- the user to be redirected to https://xx.com/dd
- for https://xx.com/dd to internally call /yyy/dd
Then the iRules snippet I gave above, if applied to both the http/https virtuals, will do what you want (reproduced here with minor change)
when HTTP_REQUEST {
if {[string tolower [HTTP::uri]] eq "/dd"} {
if {[TCP::local_port] == 80} {
Force to HTTPS
HTTP::redirect "https://[HTTP:host][HTTP::uri]
return
} else {
It's already HTTPS, rewrite URI
HTTP::uri "/yyy/dd"
}
}
}
Otherwise I am unsure what is needed.
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