This is not your iPhone, browser or even the website's publisher - it's spamy ads that hijack your browser through deep linking. Clearing browser cache and restarting Safari or Chrome won't help.
Many websites use third-party advertisement networks to bring in the revenue, and the ad networks deliver ads based on your browsing history (via cookies or link tracking - think FB likes, tweets, insta, etc. buttons) and browser profile (you'd be surprised how identifiable you are just by the settings in your browser, your IP address and OS configuration). The website's publisher most likely isn't even aware of what's being advertised on their website and even less so that some of the ads are redirecting their visitors to fake sites...
Unfortunately, prevention has to happen on the server side - not your phone. And likely the only thing *you* can do is advise the website's owner - capture the screen you've been redirected to and provide any additional observations that could be relevant, like the page URL you were on, how long it took before you got presented with the "popup", etc. The owner could escalate it to their ad agency and possibly identify the spammer and block them, install a scanner on their web servers that inspects ads for redirects, etc. You could also disable JavaScript in your Safari settings but that would make most websites unusable.
Good luck!