Block all url and traffic internet but not yahoo and facebook

Hello,
i want to block all url and traffic internet in mikrotik but leave yahoo and facebook

you can enable web-proxy feature or use IP firewall.
With IP firewall you should find all facebook and yahoo IP’s and allow them on your router and then deny all traffic from the internet , using url (Layer 7 filtering) may not work because both sites use SSL data encryption

Dear shayan,
I want to do the same config but i need more details from you.
Note that I had used web-proxy but it was not work!
Thanks for your help.

Web proxy, don’t block url HTTPS

Search the internet for yahoo and facebook IP’s then we can easily drop other packets !