Block all http sites and some HTTP exception allowed

I have been struggling for days to find how to block all sites in http (port 80) but I allow what exception with http in whitelist

I tried like http: // * in blacklist but it does not work …

an idea ?

thank you

I tested to block port 80 and add some url in whitelist but it doesn’t work, it cuts all http

try enabling the URL filter and inserting the rules there

I activated url filter but like writing the rule in blacklist that I want to block everything all http

I tried like that http: // * but it doesn’t block … something missing?

I believe that in the Blacklist or Whitelist box they need to be full domains listed there. i don’t believe that you can wildcard them. Someone else knowledgeable can comment if I am wrong.

For wildcard options you should use the Custom expression list box. Please note that it says

Blocked expressions (as regular expressions)

I believe that to filter out url’s starting with http:// the regular expression you would need is the following

^http\:\/\/

However, I am not very familiar with regular expressions so you need to check or other people can comment in case I have made an error.

Also if this line is literally what you used then you have a space between the : and the first /
There should be no space it should be “http://” not “http: //”

In blacklist, I tried like that but it doesn’t work :cry:
http:.*
http:*
http:+
http://*

and Blocked expressions :
^http\:\/\/

Apologies for a very basic question.

You have enabled the custom black list and custom expression list boxes and also enabled URL filter on the Proxy page and enabled the Web Proxy.

enabled the custom black list and custom expression list boxes : YES
enabled URL filter on the Proxy page : YES
enabled the Web Proxy : YES

it drives me crazy that it doesn’t work

I am sorry but I have reached my level of knowledge.
Will have to wait for other people who are more familiar with the url filter to provide more input.

if I put cbsnews.com in blacklist, it works well…

I want to stop all http and then I add ten authorized http in whitelist

I have the impression that ipfire does not like to put http in the box

thank you for your help and fingers crossed if there is a solution :crossed_fingers:

custom expression list boxes, I tried like that but it doesn’t work …

^http://(.+\.)?
^http://(.*.)
^http://?
^http://.*
^http\:/\/\
^http\:\/\/
^http:\/\/
^http:\/\/*
^http:(.*.)
^http:(.*.)?
^http://(?!(?:.*\.)?
http://(?)
^http(://?)
^http(://?)
http://(.*.)?
http://(.+.)?
^http:(?.*\.)?
^http(?.*\.)?
^http(?)

Not all of your tries are really right, but the expressions I tried so far don’t function either.
It’s really funny. I’ve played with blocking http://www.heise.de or https://www.heise.de.
Regexes without http function, with http do not.
I’ll try further. I’ve not searched in the help sites of squidguard.org, maybe there is another hint.

I think it’s not much to find “a good expression” with "http://" :grinning:

First result.
.* functions. :slight_smile:
Looks like squidGuard doesn’t compare the full URL. The trailing http:// seems to be cut off.
Unfortunately the home page of squidGuard isn’t really up to date. ‘Newest’ version is 1.3, we use 1.6
Hope, some of the core devs know more about this.

The problem with .*, https no longer works …

i need https with blacklist with all categories and block all http

I need a function like this but only http

it’s not far it’s not far :grinning:

How do you write regex to block only http and stay unblock for https?

I searched for a long time, I can see the http blocking but it remains blank page https … it drives me crazy because I spent hours looking but not found to find the solution

I am desperate :cry:

Regex is not for the faint hearted but there is method in the madness.

If I need to write / test an expression I have found this site very useful:

2 Likes

I don’t think the regular expression is the problem.
Most of the expression posted by jag jock above are valid and describe an URL starting with ‘http://’. But squidGuard doesn’t find a match.