Forum Discussion
Abe_11636
Cirrus
Sep 14, 2011simple irule not forwarding
this is my irule: (for a vip on 443)
when HTTP_REQUEST {
if { [HTTP::host] eq "http://aira.coxnet.cox.net"} {
HTTP::redirect "https://aira.coxnet.cox.net/airnetProp[HTTP::uri]"
}
}
It doesnt get forwarded; if I type in the url it goes in fine
The irule order is the last 1
member: Windows server with IIS ( it would easy to do a url forward from iis
Thanks for any advise
Joe
5 Replies
Sort By
- Peter_72728
Nimbostratus
HTTP::host only only contains the host (e.g. aira.coxnet.cox.net) not the protocol. So, the expression in your conditional will always evaluate to false. - richard_77048
Nimbostratus
I see two things with your rule.when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
when HTTP_REQUEST { if {[HTTP::host] equals "aira.coxnet.cox.net" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
- richard_77048
Nimbostratus
Crap. I had two examples there but one of them got lost... - Peter_72728
Nimbostratus
It looks like you are also trying to force SSL. So, you need to also check the protocol: - nitass
Employee
pls feel free to revise.[root@orchid:Active] config b virtual bar443 list virtual bar443 { snat automap destination 172.28.17.88:https ip protocol tcp rules myrule profiles clientssl http tcp } [root@orchid:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "aira.coxnet.cox.net"} { HTTP::redirect "https://aira.coxnet.cox.net/airnetProp[HTTP::uri]" } } } [root@orchid:Active] config curl -Ik https://aira.coxnet.cox.net/test123 HTTP/1.0 302 Found Location: https://aira.coxnet.cox.net/airnetProp/test123 Server: BigIP Connection: Keep-Alive Content-Length: 0
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