I config ubuntu server with these command.
sudo a2enmod rewrite
sudo a2ensite 000-default.conf
I edit 000-default.conf like this.
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride all
Require all granted
</Directory>
sudo service apache2 restart
I use let encrypt to create ssl. If I open myweb.com then it redirect to https://myweb.com . But if I open http://myweb.com it show apache page not redirect to https://myweb.com . It look like .htaccess not run.
This is .htaccess code.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
How to fix it?