RewriteEngine On
RewriteCond %{HTTP_HOST} ^www(.*)$ [NC]
RewriteRule ^(.*)$ https://domain.ru%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]