How do I redirect to an external domain?

I’d like to redirect from “mydomain.com/example” to like, “anotherdomain.com/example2
How can I do this?
I’ve already read ghost’s redirect tutorial
But still didn’t get it
and the redirect be like: “mydomain.com/anotherdomain.com/example2” which don’t work
What should I do?

What exactly are you trying to do? I understand you want to redirect, but why exactly? What are you trying to accomplish?

If you just have one page that should bounce users to some other url, that can be accomplished with some javascript. You could put <script>window.location.replace("http://www.w3schools.com");</script> in the specific page’s code injection head section. (Not the sitewide one.)

If you need to redirect everything, then this is probably not a Ghost question. It might be an NGINX question, or a Cloudflare question, or a DNS question… But tell us more, and someone will try to help!

As @Cathy_Sarisky says, please clarify.

If mydomain.com is your old site, and anotherdomain.com is a new Ghost site, you can accomplish redirects using Nginx.

Typically, the old redirects to the new. For example, I have a server block for an old domain that redirects to my Ghost site using rewrite, e.g.,

rewrite ^/(blog/)?$ https://anotherdomain.com/$1 permanent;
rewrite ^/(blog/)?guest-post-submissions https://anotherdomain.com/call-for-guest-bloggers/ permanent;
...