On https page the call to page with folder redirect leads to forward to http page first and than to https.
While in browser it works, in JS code which uses XHR it produces “was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint” error.
The forwarding sequence is
Fortunately for me placing the slash ‘/’ in the end of url solved the issue. But if I would not own the code, the problem will break the page.