Where did you insert it in the file? Ideally, it should be BEFORE the code that WordPress inserts.
As an alternative to this file editing, you can also use various plugins that take care of such redirects for you. Examples: https://projectdmc.org/plugins/tags/redirect/
thank you @threadi I added between BEGIN WordPress and # END WordPress. Should I think more about this, or I can ignore the fact that it disappeared?
You should never add anything to this area. For a German WordPress installation, it also says here (translated for you):
# BEGIN WordPress
# The instructions (lines) between “BEGIN WordPress” and “END WordPress” are
# dynamically generated and should only be changed via WordPress filters.
# All changes to the instructions between these markers will be overwritten
If you want to make additions, then BEFORE this code or via plugin, as described above.
thank you @threadi for this important suggestion. I didn’t know that and even in the forum of yoast they told me I had to add the code between BEGIN WordPress and # END WordPress.