title: LetsEncrypt with Apache2 Redirection
body: <p>I am struggling with the https redirection of my domain. My domain is hosted with godaddy and my server is hosted with ionos. I was able to install the ssl certification and if I go directly on https:  //domain.com it is working as expected. Unfortunately, the redirection is not working at all. </p>
  
  <p>the conf file looks like that:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerAdmin admin@domain.de
  ServerName domain.com
  ServerAlias www.domain.com
  DocumentRoot /var/www/domain.com/
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =domain.com [OR]
  RewriteCond %{SERVER_NAME} =www.domain.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  </code></pre>
  
  <p>and the ssl conf file like that:</p>
  
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost *:443&gt;
  ServerAdmin admin@domain.de
  ServerName domain.com
  ServerAlias www.domain.com
  DocumentRoot /var/www/domain.com/
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  RewriteEngine on
  # Some rewrite rules in this file were disabled on your HTTPS site,
  # because they have the potential to create redirection loops.
  
  # RewriteCond %{SERVER_NAME} =domain.com [OR]
  # RewriteCond %{SERVER_NAME} =www.domain.com
  # RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  
  
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I hope someone has an idea regarding this.</p>
  
  <p>Thanks a lot!</p>