i wanted to redirect http to https but i cant
i tried using it from htaccess file but i found out that after version 8 its not possible
so i tried to redirect using /etc/apache2/sites-available/conf
and i cant
i can connect to https itself ssl works fine
but i cant redirect http to https
i tried many stuff on the internet
heres my configuration
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin email
DocumentRoot /var/www/html/owncloud
ErrorLog {APACHE_LOG_DIR}/error.log
CustomLog {APACHE_LOG_DIR}/access.log combined
Redirect permanent / https://www.domain.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com [OR]
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
<VirtualHost :443>
ServerName https://domain.com
ServerAlias www.domain.com
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?secure/(.) https://%{SERVER_NAME}/secure/$1 [R,L]
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem