Forum Discussion
sstafford
Nimbostratus
Jul 30, 2008string based https redirect
Hi all--yes I'm new.
Have a customer that needs a specific page or two forced to https when requested by a client. After poking around some, I came up with
when HTTP_REQ...
sstafford
Nimbostratus
Jul 30, 2008Ok, I've updated after more reading--also, I've switched to the "ends_with" operator. Will this work?
when HTTP_REQUEST {
Check for given string and redirect if found
if {[HTTP::uri] ends_with "alumni/giving/gift/"}{
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
} elseif { [HTTP::uri] ends_with "alumni/giving/pledge/" } {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
} elseif { [HTTP::uri] ends_with "alumni/directory/search.aspx" } {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
} elseif { [HTTP::uri] ends_with "alumni/directory/update.aspx" } {
HTTP::respond 301 Location "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
