SSL redirecting to subdomain problem

After I added SSL via let’s encrypt on my subdomain my main domain is now not working it’s always redirecting to the subdomain and even the login of the main domain it always redirect to the subdomain.

how to fix this?

UPDATE:

after deleting the subdomain that I created my ssl worked it any fix on this?

it seems that having multiple ssl can cause error ? temporary I disabled the ssl for the subdomain just for my main site to have ssl. hopefully there is a quick fix for this