Use JavaScript to redirect to https for nonlocal