Forum Discussion
thashack00_9151
Oct 07, 2013Historic F5 Account
Redirect https:// to https://www
Hello DevCentral members!
I am trying to write an iRule to redirect my host from https:// to https://www for all requests. My rule is listed below. Does this look like it will work? I want to ru...
JRahm
Admin
Oct 07, 2013you don't have to use an iRule in 11.4.x, you can use the centralized policy matching functionality that is replacing the httpclass. Here's a tmsh example of simple redirecting host to ssl:
ltm policy cpm.ssl_redirect {
controls { forwarding }
requires { http }
rules {
cpm.ssl_redirect.rule {
actions {
0 {
http-reply
redirect
location https://[HTTP::host][HTTP::uri]
}
}
conditions {
0 {
http-host
host
ends-with
values { hostname.net }
}
}
ordinal 1
}
}
strategy first-match
}
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