Forum Discussion
Kanghis_23583
Nimbostratus
Feb 10, 2009http to https redirect
This is a fairly common task: a shopping cart application requires us to secure the transaction. Without the big-ip in place, the flow redirects any request to http:/this.domain.com/this/directory t...
L4L7_53191
Nimbostratus
Feb 10, 2009Here is a very generic approach, ripped right from the ask.f5.com solutions (SOL3847 to be exact). This one redirects all traffic to its https counterpart:
rule redirect_rule {
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
The only difference here is that you want to do some basic URI switching (also note that you can accomplish a similar thing with an HTTP class profile, so you may want to check that option out as well).
I think you may be looking for "contains" instead of "equals"; at the bottom of your post you indicate a "*", which tells me there's more stuff following '/this/directory/', which may not match exactly. I don't have a lab box handy but this should get you close:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/this/directory/" } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
I hope this helps,
-Matt
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