Move redirect on bad keys after detection for bad requests

The latter does better redirects in some cases