Forum Discussion
scottl_82413
Nimbostratus
Feb 07, 2008Don't redirect to SSL if URI exists
I'm trying to create an irule that will redirect:
http://www.mysite.com to https://www.mysite.com
however, if someone goes to http://www.mysite.com/training
I don't want ...
hoolio
Cirrostratus
Feb 07, 2008It sounds like you want to allow HTTP access to any URI starting with /training, not just equal to /training. Can you try this version?
when HTTP_REQUEST {
log local0. "Client [IP::client_addr] requested [HTTP::host][HTTP::uri]"
Check if requested path doesn't start with /training
if {not ([HTTP::path] starts_with "/training")}{
log local0. "Redirecting client [IP::client_addr] from [HTTP::path] to [HTTP::host][HTTP::uri]"
Redirect request to the same host/uri, but via HTTPS
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}Aaron
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