Http to https redirect does not work

My domain is:
genemattos.com

My web server is (include version):
Apache2

The operating system my web server runs on is (include version):
Ubuntu 19.10

My hosting provider, if applicable, is:
Linode

I can login to a root shell on my machine (yes or no, or I don’t know):
Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot 1.3.0

=======================================
https://www.genemattos.com works
http://www.genemattos.com does not work

.conf file is below

<VirtualHost *:80>
ServerName www.genemattos.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
#RewriteCond %{SERVER_NAME} =genemattos.com [OR]
RewriteCond %{SERVER_NAME} =www.genemattos.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Try

DocumentRoot /var/www/html
<Directory />
    Require all denied
</Directory>
Alias /.well-known/acme-challenge /var/www/acme
<Directory /var/www/acme>
    Options None
    AllowOverride None
    Require all granted
</Directory>
<Directory /var/www/html>
    Redirect permanent / https://www.genemattos.com
</Directory>

Run this command and tell me if tells you something like “Listen 80” somewhere:

grep -ir "Listen" /etc/apache2

Also check your firewall on port 80.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.