core: fix for forced host/protocol redirects by mod_ssl
(cherry picked from commit 8584daf8f1d7bdba1def9576ab1fa4ec6a35af18)