Use Javascript to redirect to https for nonlocal