Forum Discussion
redirection irule does not work on chrome and Firefox
Hi experts, i have the following redirection irule -
when HTTP_REQUEST { if {[HTTP::host] equals "www.example.ca"}{ HTTP::redirect "https://example.ca" } }
so when a client opens https://www.example.ca in IE 8, the redirection sucessfully works to https://example.ca.
But does NOT work in Chrome and Firefox (ver 35.0).
Please advise?
7 Replies
- cjunior
Nacreous
this may be obvious but, have you looked in the debug screen (F12) if it is receiving HTTP code 302 for redirection? there were open connections in this browsers when you applied the iRule? - sandy16
Altostratus
Hi, the irule has been applied on the VS. I ran F12 on FF, but there is NO 302 http redirect there. I have deleted all my cache and reopened my session, but still the same.
- Chris_Miller
Altostratus
Can you add a log statement in the rule so we capture whether it's getting hit? Some browsers like to automatically throw the www in but I'd be surprised if that happened unless you didn't have a root record in DNS.
- sandy16
Altostratus
ok, how can i debug this irule? There are DNS records for both www.example.ca and example.ca
- cjunior
Nacreous
Try:
when HTTP_REQUEST { log local0. "requested host: [HTTP::host]" if { [string tolower [HTTP::host]] equals "www.example.ca" } { log local0. "Sending HTTP 302 redirection" HTTP::respond 302 Location "https://example.ca" } else { log local0. "Do nothing for current request" } }and tail the LTM log on ssh Linux:
tail -f /var/log/ltm Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : requested host: www.example.ca Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : sending HTTP 302 redirection - sandy16
Altostratus
Thanks, i am getting random results in IE now. I want to get re-directed even before any SSL negotiation happens in order to avoid the invalid CN name ssl error. But now it does not seem to be doing that. I always get an privacy error/ssl-error and then once i accept it, i get re-directed.
This worked in IE before, the redirection was happening first before any ssl-nogotiation.
- cjunior
Nacreous
I do not know when it's possible because the connection will know the URL only after established. I know we can use TLS/SNI to connection choose the appropriate certificate on ssl handshake, but it can be incompatible in legacy systems. So I do not know how to tell you a better solution right now.
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
