Need a working solution to redirect on page-forbidden and page-not-found

I’ve tried that, but I don’t see any difference. If I go to /foo with it enabled or disabled, I get the same thing. (I’ve customized the text to try to give them a clue why, but that’s not very satisfactory.)