You may want to remove that second RewriteEngine On from the file. Whenever that line is run, any rewrite rules set previously are cleared. This is a useful feature in some cases (e.g. when you’re installing another script in a subdirectory). But in this case, it also removes the rewrite rules of your own software.
for some reason now it went back to directing to http instead so I redirected it using the redirect now it is pointing to https but the content is showing the too many redirect error, any ides how to fix this?
Do not use the redirects tool to redirect to your own domains. It will just create a redirect loop. Remove the redirect you added through the tool and don’t touch the tool again.
Looking at your .htaccess code, maybe you need to move the .htaccess code for the HTTPS redirect above the existing rewrite rules. So just below the last </FilesMatch> line. Your current .htaccess rules may capture the request before it matches the HTTPS code.
now it seems to direct to https but now I get no content and the error says " |Message:|SQLSTATE[HY000]  Connection refused|
| — | — |
For me it throws an ERR_TOO_MANY_REDIRECTS error. Please remove all of your redirect codes from the “Redirects” section of the Control Panel, and then correct your .htaccess file to have these rules instead:
I did some testing on your account, and even when I remove all .htaccess related code, your site appears to enforce non-HTTPS URLs on your site. Can you please check the configuration of your website to see if it has any way to configure HTTPS or website URLs? Because enforcing HTTPS in your .htaccess file won’t get you anywhere if your website code then enforces HTTP.