Forum Discussion
HTTPS Redirect for a specific URL, URI
when HTTP_REQUEST {
if {([HTTP::host] equals "www.joe.com" and
([HTTP::uri] equals "/net/myjoe")}
{ HTTP::uri "https://www.joe.com/net/myjoe"
}
}
When a client request "http://www.joe.com/net/myjoe" I need them to be redirected to "https://www.joe.com/net/myjoe".
But if they request any other uri at www.joe.com using http I need that traffic to be passed to the pool.
Will the above iRule work?
12 Replies
- Kirit_107311
Nimbostratus
This setting worked well for both pages. Thank you guys for assisting.
HTTP VIP: when HTTP_REQUEST { if { ( [string tolower [HTTP::uri]] starts_with "/contact-us" ) or ( [string tolower [HTTP::uri]] starts_with "/feedback" ) } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
HTTPS VIP: when HTTP_REQUEST { if { not ( [string tolower [HTTP::uri]] starts_with "/contact-us" ) and not ( [string tolower [HTTP::uri]] starts_with "/feedback" ) } { HTTP::redirect "http://[HTTP::host][HTTP::uri]" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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