Forum Discussion
rdessert_76127
Feb 16, 2012Nimbostratus
Force 301 redirect to https for multiple http URI's
I need to write an irule for use on my http virtual server that will perform a 301 redirect to https for two possible http URI's. I figured out how to do it for one URI, but am struggling with prope...
Michael_Yates
Feb 16, 2012Nimbostratus
Hi rdessert,
Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc" || [string tolower [HTTP::uri]] starts_with "/def" } {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : "1"][HTTP::uri]"
}
}
Hope this helps.
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