Need help with an irule to redirect with exceptions for certain pages
First time posting here and need some assistance. My company is requesting an irule to redirect certain websites to another site but NOT other portions. Here is an example:
Let's say a user points to http://www.mysite.com redirect them to http://www.myothersite.com/mysite however DON'T redirect them if they go to http://www.mysite.com/specificpage.aspx and they have, in some cases, a site with up to 20 different pages that are exceptions to this redirect.
I have this irule and can get the first exception to work but when I try to add more it seems to only work on the first match. Also since I have, as mentioned, 20+ matches in some cases, might it be better to do some kind of table lookup? But I am not clear on how to do that. Any help is appreciated. Here is what I have so far that works, but only with 1 exception so far (no matter how many if/or statements I've added):
when HTTP_REQUEST { log local0. "in HTTP_REQUEST" if {[HTTP::uri] equals "www.mysite.com/clocks.asp"}{ if {[HTTP::uri] equals "www.mysite.com/images/*"} { <----this is not matching, for example
pool www-mysite_pool } else { HTTP::respond 301 location "" } }
ANY help at all is appreciated. I am a networking guy with little programming experience and am surprised I even got a simple redirect to work to be honest but they are pounding hard for me to get this to work. Thanks!