Forum Discussion
Sonny_J_Bonds_1
Nimbostratus
Jun 09, 2015http to https redirect working but want to add www.
Hi,
This iRule is working to redirect http to https and leaving the hostname intact. Exactly what I want.
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::u...
stan_piron
Cumulonimbus
Jun 22, 2015Your irule does not include uppercase URLs:
the following irule will allow you to redirect needed hosts:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"abc.com" -
"www.abc.com" -
"*.abc.com" { HTTP::redirect https://www.abc.com[HTTP::uri] }
}
}
I added www.abc.com and *.abc.com to show different ways with switch command.
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