more fixes for ssl and redirect support