Если я наберу http://example.com, он станет http://www.example.com.
. Перенаправление www работает, но не https.
Но оно работает в моих статьях (home.php), если я введу www.example.com/article/1/article-name, он станет https://www.example.com/article/1/article-name, как я и хотел.
Почему он не работает с 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