Redirecting one domain to another

I have 2 domains on Cloudflare and one points to an IP address where a website is hosted.
I would like the second domain to redirect to that website. How can I set this up?
The domain name should also be replaced in the browser URL line.

E. g. mydomainA.com points to webserver.
When typing mydomainB.com into the browser the user should see the mydomainA.com website and URL.

First make sure the domain you want to redirect is getting proxied :orange: then just use a PageRule that redirects traffic like this:

mydomainB.com/*
Forward URL (302)
https://mydomainA.com/$1 (or) https://www.mydomainA.com/$1

Once it works, you can change the redirect code from 302 to 301.