Re: [squid-users] Blocking URLs

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 2 Jul 2003 21:22:42 +0200

On Tuesday 01 July 2003 09.03, Li Wei wrote:

> acl badURL2 urlpath_regex -i /.mp3 /.wma /.avi /.mpg /.mpeg /.swf
> /.asf /.rm /.ram

These regexes are very broad. regex patterns are not just matching the
end of a URL, they are mathing the specified sequence of characters
anywhere within the url, and for urlpath_regex (and url_regex) this
includes anywhere within query arguments.

If you want to match file extensions then you should anchor the
extension at the end of the URL. Also, the . needs to be excaped
using \ not /.

As Andrew indicated your problem is the /.ram pattern, as this matches
/fram in the URL below (/ followed by any character followed by r
followed by a).

The following pattern should be more suitable for matching file
extensions:

acl bad_extensions urlpath_regex -i \.mp3($|;|?) \.wma($|;|?) ....

Regards
Henrik

-- 
Donations welcome if you consider my Free Squid support helpful.
https://www.paypal.com/xclick/business=hno%40squid-cache.org
If you need commercial Squid support or cost effective Squid or
firewall appliances please refer to MARA Systems AB, Sweden
http://www.marasystems.com/, info@marasystems.com
Received on Wed Jul 02 2003 - 13:22:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:17:48 MST