httpd.conf did you place it? Inside a section? Or just "bare" without any
<foo bar> and
</foo> around it?
Anyway, do note that redirecting to an IP address with HTTPS will not work in case of a Let's Encrypt certificate, as Let's Encrypt doesn't issue certificates with an IP address as a SAN (or CN for that matter). Therefore, redirecting to an IP address with HTTPS with a LE cert will give the client an error (CN mismatch).