Is it possible to build an app that blocks a homepage like facebook.com, without blocking other parts like facebook.com/profile

I’m sorry in advance for the terribly worded title. I’m really not sure how to ask the question I have. To describe the problem, I use website blockers to keep me from going to distracting websites like facebook or reddit. Having these blocked really helps for efficiency. But I often find myself unblocking them because I need some form of access to them, and catching myself on a spiral of distracted scrolling through their algorithmically generated “newsfeeds”.

There is an easy solution.

I could block the home pages. For example: If I could block “http://www.reddit.com” without blocking “https://www.reddit.com/r/AskProgramming/”, then I could block their mindless “newsfeeds” without blocking the functions that have utility, and are difficult to become endless distractions, because the rest of these distracting sites don’t have this endless generating feature.

Is this possible? i’m still new. But I’m just curious if anyone could hint at an area I should pay extra attention to, so that I could build an app like this. Or someone to tell me if it is even possible, since I can’t seem to find anyone else who has built something similar.