Forum Discussion
Ashish_R_G_2512
Nimbostratus
Oct 24, 2016Redirect www to https
Hi,
I have configured an HTTP VIP and configured irule to redirect all HTTP traffic to HTTPS VIP which I have created. It is working fine as expected. Below are the script which i have used. ...
Vijay_E
Cirrus
Oct 24, 2016Try this:
when HTTP_REQUEST {
if { [HTTP::host] eq "www.abc.com" } {
HTTP::redirect "https://abc.com[HTTP::uri]”
}
If you are looking for a generic rule, you can try something like this:
when HTTP_REQUEST {
if { [HTTP::host] starts_with "www." } {
HTTP::redirect "https://[getfield [HTTP::host] "www." 2][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