I read a lot about this issue, even on this place, but I can't figure out why it's not working.
Issue:
I can't redirect my domain. What I want is a redirect to https://www.rossotono.it.
This is the current situation:
- IT WORKS if I go to "http://www.rossotono.it", it redirects well to https://www.rossotono.it
- IT DOESN'T WORK if I go to "http://rossotono.it" or "https://rossotono.it"
so, basically, it works with www and it does not work with non-www.
Moreover, if I go to www.rossotono.it/franchising directly, it returns a 404. While if I go to www.rossotono.it/franchising clicking from a link in the website it works.
Here there are my confs:
rossotono.it.conf
<VirtualHost *:80>
ServerName www.rossotono.it
Redirect permanent / https://www.rossotono.it
DocumentRoot /var/www/rossotono.it/public_html
ErrorLog /var/log/httpd/rossotono_it_error.log
CustomLog /var/log/httpd/rossotono_it_requests.log combined
<Directory "/var/www/rossotono.it/public_html" >
AllowOverride All
</Directory>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:80>
ServerName rossotono.it
RedirectMatch permanent ^/?(.*) https://www.rossotono.it/$1
</VirtualHost>
rossotono.it-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName www.rossotono.it
ServerAlias rossotono.it
DocumentRoot /var/www/rossotono.it/public_html
ErrorLog /var/log/httpd/rossotono_it_error.log
CustomLog /var/log/httpd/rossotono_it_requests.log combined
<Directory "/var/www/rossotono.it/public_html" >
AllowOverride All
</Directory>
SSLCertificateFile /etc/letsencrypt/live/rossotono.it/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/rossotono.it/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/rossotono.it/chain.pem
</VirtualHost>
</IfModule>
What I tried:
- flushdns on my pc
- connecting on website from another pc using another connection
Thanks to those who are gonna help me.