I installed squid which is listening on port 3128. Now, I would like to show an error webpage to every user who tries to connect to any http/https webpage and doesnt have proxy set up. What parameter do I need to set up?
I don't think you can get squid to do this for you.
You need to redirect outgoing http/https traffic on your router to some local webserver that responsd with the given error page no matter what URL is requested.
The redirection is easiest when you have the webserver running on the gateway itself; you can then add rules like this:
iptables -t nat -A PREROUTING -p tcp --dport http -j REDIRECT iptables -t nat -A PREROUTING -p tcp --dport https -j REDIRECT
This will send any traffic destined to those ports to the local system.
Note that for https traffic the use will get a certificate error, as the certificate used by the local system most certainly will not match the hostname requested.
On the webserver side you can use the index.html page with your message as the 404 error document, so that no matter what URL is requested, that page is served.
Of course the simplest way is just to reject all http/https traffic, the browser will give an error. You can use
--reject-with adm-prohibited, hopefully the browser will pass this status on to the user.