run secure functionality when domain requires secure submission

even when hitting the insecure URL
Merge pull request #3477 from dimagi/redirect-secure

run secure functionality when domain requires secure submission