Search squid archive

Re: url blocking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 9 Feb 2011 13:37:26 +0000, "Zartash ." <zartash@xxxxxxxxxxx>
wrote:
> Dear All,We are blocking urls using url_regex feature (urls are stored
in
> a file), but we are unable to block urls having special characters (like
> complete youtube video links or urls having % sign or ? etc). Can any
one
> let me know how can we block specific urls (rather then blocking whole
> domain)?

To regex match characters which are reserved in regex you need to escape
them with \ characters:
  
  url_regex http://example.com/\?hello=world

matches:  http://example.com/?hello=world


  % are slightly different, in URLs they are used to encode raw binary
characters. These are decoded back into binary form for the match. So your
pattern wanting to detect a specific one of these should match the binary
form. eg. %20 encodes hex binary 0x20 or character value 32 (spacebar).

Amos



[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux