On a centos8 server I created a file called /etc/httpd/conf.d/rewrite.conf with these contents:
RewriteEngine on
RewriteRule (.*) https://www.othersite.com [L,R]
If I goto http://myserver.com it gets redirected to https://www.othersite.com as expected. But, if I goto https://myserver.com its not being redirected. I just get the regular index.html. There's a valid cert installed.
Should it work like that or does apache need additional rewrite rules in the SSL virtual host definition?