If I understand your setup, you have some external domain, example.com, controlled by a 3rd party, with a website running on it, controlled by someone else. You want to allow access to that site generally, but block certain URLs.
There are a few solutions to this; they all boil down to some sort of proxy server. You would proxy web traffic via this proxy server and have a block/redirect list configured in it, which would deal with predefined exceptions.
One free solution is squid caching proxy, which does have redirectors support (here are details in the documentation - https://wiki.squid-cache.org/Features/Redirectors). Do note though that it's very much not trivial to set this up correctly and maintain it. No disrespect, but based on the fact that you had to ask this question, I suspect you may struggle to do this successfully.