April 2026
Redirect a Site to a New Domain in Netlify
Put this in your .netlify.toml
file to redirect all the content from one domain to another:
[[redirects]]
from = "/*"
to = "https://www.example.com/"
status = 301
force = trueNote that this uses a 301 instead of a 308 redirect indicating that the client can change POST requests to GET requests which is what I want most of the time since it's most likely that there won't be the same POST receiving pages on the new site.
(The mechanism for switching from POST to GET will vary among clients. There's no guarantee it'll happen, but at least it has a chance with a 301.)
end of line