Problem
I have moved my website to a new domain.
When I go to the new domain, WordPress redirects to the old domain.
Solution: Change Site URL in Database
You have to change the website url in the database.
You can do it through phpMyAdmin or a similar tool.
Manually edit the values for siteurl and home in the table wp_options.
Or you can run these updates:
UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://yournewdomain.com' WHERE option_name = 'home';
Obviously, replace “https://yournewdomain.com” with your actual new website url.