If I type http://example.com it will become http://www.example.com.
The www redirect is working, but not the https one.
But it is working in my articles (home.php), if I type www.example.com/article/1/article-name it will become https://www.example.com/article/1/article-name as I wanted.
Why it is not working on index.php?
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule ^page/(.*) /index.php?pagina=$1
RewriteRule ^article/(.*) /home.php?id=$1
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
ErrorDocument 404 /404.php
AddCharset UTF-8 .htm
AddCharset UTF-8 .html
AddCharset UTF-8 .php
Options -MultiViews
options -indexes