Forum Discussion
jgoetsch_236444
Nimbostratus
Nov 30, 2015Prepend www, redirect to https, and preserve full URL
Hello All,
I would like to use an iRule that does the following type of redirect/rewrite:
http://testsite.com/about -> https://www.testsite.com/about
Ideally, if other valid urls like ...
VernonWells
Employee
Dec 01, 2015If you are running at least 11.4, you can also achieve this using a Local Traffic Policy
It might look like this:
ltm policy www-redirect-append {
controls { forwarding }
requires { http }
rules {
rule-testsite.com {
actions {
0 {
http-reply
redirect
location "https://www.[getfield [HTTP::host] : 1][HTTP::uri]"
}
}
conditions {
0 {
http-host
values { testsite.com }
}
}
ordinal 1
}
rule-default {
actions {
0 {
http-reply
redirect
location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
}
}
ordinal 2
}
}
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