Hi all
I am trying to use this redirect for a site; however, it fails when a browser appends a / at the end of the URI.
How can I fix the irule to allow both /puck and /puck/
when HTTP_REQUEST { if {[HTTP::host] equals “www.school.com ” and [HTTP::uri] equals “/puck” } { HTTP::redirect “http://www.school.com/continuingstudies/programs-and-courses/package-and-courses ” } }
Thanks
nathe
August 25, 2015, 2:46pm
2
Instead of equals “/puck” you could use starts_with “/puck”
Hope this helps,
N
Hi Nathan
I had started with this syntax but we have other sites that also start with puck. This would then encompass those sites as well.
chung
nathe
August 25, 2015, 4:09pm
4
Does this help?
when HTTP_REQUEST {
if {[HTTP::host] equals "www.school.com" and ([HTTP::uri] equals "/puck" or [HTTP::uri] equals "/puck/")} {
HTTP::redirect "http://www.school.com/continuingstudies/programs-and-courses/package-and-courses" }
}
N
Hi there
Thanks, that is perfect. Very much appreciated.
Regards
Chung
nathe
August 25, 2015, 7:14pm
6
No probs. Mark up if happy