Again if the goal here is redirecting reddit to a frotnend with no extension DNS Rewrites can serve that too. And it is a more recommended method than editing the hosts file.
I do agree you can stumble upon the certificate error however manually allowing it should work and redirect but it may still be annoying so proceed with caution about this.
Honestly the warning is legit though because the next thing you want is for hosts and dns rewrites to be used maliciously.