Support custom SSL hosts, and fixed SSL feature

The issue was as soon as we turned on SSL, the non-SSL login would start failing. This is because the protocol check would kick in, and then block the login from working.

I've added a feature flag check (which I'm not mad on) which fixes this so that if the feature flag is enabled for the request, then the url redirect kicks in. If it's not enabled for the user, then the redirect is ignored entirely.

Related (and fixes #1234)