moving SSL removal into rewrite to preserve URIs