Jump to content

Hi! So recently I set up a Pi Hole on my Raspberry Pi zero. And there are some ads that I want to blacklist but they are when I follow the link from the ad(I mean the source for it not the site it redirects to) it is actually a jpg. The ad is a jpg image. And if I get the exact url for example"cdn.website.com/image.jpg" and add it to regex blocking since it doesn't allow me to add this type of url to wildcard or exact blocking it doesn't work. All the other ads that I have blacklisted are blocked but this one still remains even if I blacklist the exact url of the jpg image. And if I blacklist not the jpg url itself but the site that it is connected to("cdn.website.com" not "cdn.website.com/image.jpg")well then since the site I am visiting is actually "website.com" blacklisting "cdn.website.com" actually either breaks the functionality of the website or it makes it load as plain HTML(you know only text links no GUI). So can how do I fix that? Can I block these ads without breaking the site or going back in time to the year the GUI didn't exist? :D

 

Link to comment
https://linustechtips.com/topic/1173650-pi-hole-regex-blocking/
Share on other sites

Link to post
Share on other sites

You have to bear in mind that PiHole is a DNS filter.

Your browser is never going to do a lookup for "cdn.website.com/image.jpg", just "cdn.website.com" or "website.com". And if the site has parts of itself in both places, you will always be blocking at least one of them. What you are looking for is a content filter, a web proxy.

Link to comment
https://linustechtips.com/topic/1173650-pi-hole-regex-blocking/#findComment-13458360
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×