Forum Discussion
Ahmad_03_151082
Nimbostratus
Jun 08, 2015Redirect from HTTPs to HTTP
Hi
I have WebSite
xyz.com/something
works in HTTPs
I want this Website to work in HTTP
http://xyz.com/something
except specific URLs to work with HTTPs
EX:
https://xyz.com/something/somthingelse
ht...
Michael_Jenkins
Cirrostratus
Jun 08, 2015For that, you'll need to have the 2 VIPs (one for http and one for https), and on the HTTP vip, you could use an iRule like this to force https:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/something/somethingelse*" -
"/something/anything*" {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
default {
Do nothing for the rest of them
}
}
}
Then if you want the opposite for the HTTPS VIP, you can just create a new iRule basically the same except that you redirect in the the
default section instead and do nothing in the matched section of the switch statement.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