referer header
2 Topics2 http request rules merge to one - one referer the other set access only
Hi I have two rules that work individually. But when i try and combine get no luck and just redirects everything to the default location. The first rule is to only allow the uri path in the irule, otherwise redirect to Unathorized page. Second is to only allow the request if it comes via 3 set referers. It would be much appreciated if someone can please help combine both of these? 1st RULE when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] switch -glob $uri { "/path1/path2/path3*" - "/path4/path2/path3*" - "/path1/path2/path5*" - "/path4/path2/path5*" { redirect to Pool pool POOL_Servers_to_access-80 } default { log local0. "Other access not allowed $uri” HTTP::redirect "http://www.notallowed.asp" } } } 2nd RULE when HTTP_REQUEST { switch -glob [string tolower [URI::host [HTTP::header "Referer"]]] { "goodlocation.com/*" - "anothergoodlocation.com/*" - "youcanalsologin.com/*" { } redirect_to_location_to_sign_in_first "" { HTTP::redirect "http://goodlocation.com" } Allow Request to go through... default { pool POOL_Servers_to_access-80 } } } Thanks in advance. cheers Brett373Views0likes4CommentsRedirect and Referer in iRules
Hi everyone, I've got what I'm sure is a very simple problem. I am deprecating a URL and for a period of time want to do a 301 redirect and insert a "Referer" value on the redirected traffic so I can see how much was hitting it. I've got this so far as an iRule but it's throwing errors when I try to save it: when HTTP_REQUEST { set refer [HTTP::header "Referer"] {HTTP::header insert “Referer” “foo.bar.com” HTTP::respond 301 Location https://bar.com[HTTP::uri] } } Thanks for any and all help! Sean410Views0likes4Comments