The redirect with .htaccess of the main domain without "www" like "mydomain.com" doesn't work, leaving the address in the ordinary http://, so what's wrong with this code? and how to force the redirect of all addresses to https://?
ErrorDocument 404 /404.php
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www.(.*) [NC]
RewriteRule ^(.*) https://%1/$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1