Redirect from example.com to www.example.com

I have a website that cannot automatically redirect when user hit http://example.com or https://example.com. The response for http is {“message”:“no Route matched with those values”} and if using https the response is NET::ERR_CERT_AUTHORITY_INVALID

How to setup the KongIngress or KongPlugin to redirect from http://example.com or https://example.com to https://www.example.com