Confused - Certificate Name Mismatch after installing

@Bruce5051
Thanks for your advice. Thinking about what you said. ... Is it this part of my config that is causing the issue.

    if ($host = www.collegiansfc.org) {
            return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = collegiansfc.org) {
            return 301 https://$host$request_uri;
    } # managed by Certbot

How can I have them both be forced to https without changing the domain placed into the browser.
Thanks
Lawrence