Post Reply 
Stop Automatic Redirects
Dec. 04, 2009, 04:45 AM (This post was last modified: Dec. 04, 2009 05:05 AM by Kye-U.)
Post: #1
Stop Automatic Redirects
Motivation for this filter comes from OpenDNS redirecting me to their sponsored search results page after typing in a non-existent domain. It works with all URL shortener services as well Smile! It's like this Firefox add-on: http://code.kliu.org/noredirect/

This filter will stop ISP DNS redirection hijacking and URL shorteners from automatically occurring without your consent.

Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "!-|||||||||||| URL: Stop Automatic Redirects [ku] (In)"
URL = "$RESP(30[1237])"
Match = "$IHDR(Location: (http(s|)://\1/\2)\3)(^$TST(\1=www.\h))$CONFIRM(The page wants to redirect to the below URL:\n\n\3\n\nKill the connection?)"
Replace = "\k"

Read more on the different response codes that are matched in this filter (301, 302, 303, 307): http://en.wikipedia.org/wiki/List_of_HTT...edirection

It tests if the redirection URL is simply prefixing the host with "www."), as there were false positives when loading Google.com and Youtube.com.


Attached File(s)
.png  filter.png (Size: 9.46 KB / Downloads: 639)
Visit this user's website
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: