Server Error (5xx) for changing to a "WWW"

My blog was a non-www site and now it is a “www” site. Google Console is finding the original ones (without “www”), so it is giving a Server Error (5xx) each time it finds those links. It found 18 already! What can I do?

Set up a www redirect:

1 Like

Thank you. I just watched the video. The only thing is that I think it has to be “301 - Permanent Redirect” because I think it will stay like that forever. If I am wrong let me know. I want to try this as soon as possible to fix the problem.
I appreciate your help.