Forum Discussion
Adam_Fint_1489
Aug 02, 2011Nimbostratus
HTTP::Querry matching referal?
I have a BigIP running 9.4.7 HF2 (it is scheduled to be upgraded to 10.x in a month or two). I have an iRule who's behavior does not make sense to me, but I fairly new to iRules.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::query]] {
"*db_oem_id*" {
HTTP::respond 301 Location "http://[HTTP::host][HTTP::path]"
}
default {
nothing
}
}
}
Basically, I'd like to see if the HTTP query (the part of the URL after the ?) contains db_oem_id, and if so, redirect back to the same page, but without any query at all. This works for the most part; however, if you are coming FROM an external page that has db_oem_id in it, the F5 is still redirecting, based (I'm guessing) on the Referer (which then causes an infinite loop). This behavior seems odd to me. Am I doing something wrong? The below is from a Wireshark capture.
GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.goxxx.com/ViewArticle.dbml?DB_OEM_ID=500&ATCLID=205178399&KEY=&DB_OEM_ID=500&DB_LANG=C&IN_SUBSCRIBER_CONTENT=
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; FunWebProducts; GTB7.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; AskTbAD2/5.9.1.14019)
Accept-Encoding: gzip, deflate
Host: www.shopgoxxx.com
Connection: Keep-Alive
Cookie: ASP.NET_SessionId=jn2xr0ezkbj4fa55ksxa0v45; ffSource=; usrPref=05c8440c-4b0e-44ca-bd25-d01419d4d5e2; BIGipServerFFPartners-Pool=RVM6E8bLwY+TvJjRrm9lOpnLtsM/K95zeoCmTACDxaJVEZkxXi/0AOebYRZpW8MVeL8C1JSpkg==; TLTHID=81A4036943F9D99CE96669BC9EF7017D; TLTSID=5F63163649E1ACC53E3FA990701A2843; __utmc=255568202; __utma=255568202.747088971.1311879674.1311879674.1311879674.1; __utmz=255568202.1311879674.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=255568202.|1=psid=08779=1
HTTP/1.0 301 Moved Permanently
Location: http://www.shopgoxxx.com/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
- Michael_YatesNimbostratusIt should not be using the Referrer information unless you specifically direct it to.
- The_BhattmanNimbostratusHi Adam,
when HTTP_REQUEST { if {[HTTP::host] eq "www.domain.com" } { switch -glob [string tolower [HTTP::query]] { "*db_oem_id*" { HTTP::respond 301 Location "http://[HTTP::host][HTTP::path]" } } } }
- Adam_Fint_1489NimbostratusThere was another iRule being applied to this same vip:
- The_BhattmanNimbostratusHi Adam,
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