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 ...
Mark_22062
Nimbostratus
Nov 30, 2015Hi Jason,
Give this a try.
when HTTP_REQUEST {
if { [string to lower [HTTP::host]] eq "testsite.com" } {
HTTP::redirect https://www.[getfield [HTTP::host] ":" 1][HTTP::uri]
}
else {HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]}
}
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