block suburl in Squid

0

Im trying to block one page from website on Ubuntu. For example the website is www.linuxquestions.org which I want to allow, but www.linuxquestions.org/reviews/ I want to deny. I found out that I cant use etc/hosts. So Im using squid proxy. I have file with URLs which I want to block.

File looks like this:

https://maps.google.com/
maps.google.com
www.linuxquestions.org/reviews/

I set this file to be blocked in /etc/squid/squid.conf

acl blocksites dstdomain "/etc/squid/file.squid"

For maps.google its working, when google Im able to use, but maps.google not. Is it possible to block only www.linuxquestions.org/reviews/ but everything else on www.linuxquestions.org will be accessible?

Hanka

Posted 2017-07-17T07:59:54.710

Reputation: 141

Answers

0

in /etc/squid/squid.conf dont use acl blocksites dstdomain "/etc/squid/file.squid" but

acl blocksites url_regex "/etc/squid/file.squid"

then in file it can be only .linuxquestions.org/reviews no full url

Hanka

Posted 2017-07-17T07:59:54.710

Reputation: 141