Forum Discussion
mofathy_63257
Jul 16, 2017Nimbostratus
redirect http://www.{URI} & http://{URI} to https://{URI}
Hi
We have a situation where the published website is needs http to https redirect and in the same time gives an error when accessed using www.{URI}
So may you help with the iRule syntax that : ...
Jul 16, 2017
I would split it into two rules.
Apply this to the HTTP VIP:
when HTTP_REQUEST {
HTTP::respond 302 Location "https://test.com[HTTP::uri]"
}
Apply this to the HTTPS VIP:
when HTTP_REQUEST {
if { [HTTP::host] eq "www.test.com" } {
HTTP::respond 302 Location "https://test.com[HTTP::uri]"
}
}
That should take care of all the scenarios you mentioned.
/Patrik
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