Moving a site to a new domain is mostly a paperwork job, and the most important page of that paperwork is the redirect list. Every old URL that has been bookmarked, linked to or indexed will keep asking the old domain for an answer after the move. If nothing answers, those visits end at a dead end. If a redirect answers, the visitor lands on the new domain as if the move had been planned all along.
This guide shows how to build that list with the free Redirect Rule Generator on Ovatly. The list has one row per old path, each pointing at the same path on the new domain, with the permanent 301 code. It is exported in the format your old host actually reads.
Contents
- Quick answer
- What a domain change asks of redirects
- Why 301 is the code for a move that is not coming back
- One row per path: building the list
- How to write the rules, step by step
- Worked example: one row of the move
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
For a domain change, list every important path on the old domain. Pair each one with the same path on the new domain, and give every row a 301 status code, because the move is permanent. Open the Redirect Rule Generator and enter the rows. Choose the output format that matches the old domain's hosting (.htaccess for Apache, Nginx syntax, or _redirects for Cloudflare Pages and Netlify). Then deploy the result on the old domain, where the old URLs are answered. Then test every path by hand. The generator validates the shape of the rules only; it cannot move DNS, hosting or content for you.
What a domain change asks of redirects
A redirect rule is a standing instruction left at an old address: when a request arrives for this path, send it to that path instead. The instruction carries a status code describing the move. A domain change needs one of those instructions for every path that matters on the old domain. That means the home page, the pages other sites link to, and the pages that earn steady traffic. It also means utility pages such as contact and privacy.
Paths that nothing links to and nobody visits can be left behind deliberately. What you cannot do is assume the move carries the old addresses along. DNS points the new domain at a server; it does not teach the old domain's URLs where they went. The redirect list is that teaching, written down.
Why 301 is the code for a move that is not coming back
The generator lets each row carry its own status code: 301, 302, 307 or 308. A domain change is a permanent move, so 301 is the honest code for every row. It tells browsers and search engines that the old address has retired and the new one is its replacement, not a temporary detour.
Using a temporary code for a permanent move sends a mixed signal for as long as the rules stay up. And domain change rules tend to stay up for years. Consistency also makes the list easier to audit: a differing row stands out as a deliberate exception or a typo.
One row per path: building the list
Work through the old site in order of importance. Start with the home page and top-level sections, then pages with inbound links or steady traffic, then pages that still deserve a landing place. For each one, the row is simple. The from path is the path as it exists on the old domain. The to path is the same path on the new domain, written out in full so there is no doubt about where it lands.
The tool refuses a duplicate from-path, which is a genuine safeguard during a move. Two rules competing for the same old address is exactly the kind of error a long list invites. Better to be stopped while typing than to have a browser pick one of two answers at random after deployment.
How to write the rules, step by step
- Open the Redirect Rule Generator and add the first row: the home page path as the from path. The new domain's home page address is the to path, and 301 is the code.
- Add one row per remaining path, working down your list in order of importance, keeping the code at 301 throughout.
- Choose the output format that matches the old domain's hosting. Use
.htaccessfor an Apache server, the Nginx format for an Nginx server, or_redirectsif the old site sits on Cloudflare Pages or Netlify. - Copy the generated rules into the matching file on the old domain's hosting: the
.htaccessfile, the Nginx configuration, or_redirectsat the site root. - Visit every old URL in a browser and confirm each lands on the right page of the new domain.
Worked example: one row of the move
The generator's own example pairs the from path /old-soap with the to path /soap. On an Nginx server that single row comes out as:
rewrite ^/old-soap$ /soap permanent;
A domain change uses the same row shape with a longer destination. The from path stays /old-soap, and the to field carries the new address: the new domain followed by /soap. The word permanent at the end is the 301 code doing its work.
Two things are worth noticing about the line. The from path is anchored at both ends, so it matches that exact path and nothing that merely resembles it. And regex characters in a from path are escaped automatically. So a path containing a dot still matches literally, instead of turning into a pattern you never intended.
Limitations and honest tradeoffs
The generator builds per-path rules from the rows you give it, and that is the whole of its job. A blanket rule forwards every possible old path to the same path on the new domain. It is a single server-level line you write yourself in the same file, using your server's documentation. For a large site that line may carry most of the traffic, with the generated rows covering the paths that changed shape during the move.
The tool also validates the shape of the rules only. A rule can still point at a page that does not exist yet, or at the wrong page. The generator has no way to know. Testing after deployment is part of the job.
Finally, the rest of the move is outside the tool: pointing DNS, moving hosting and copying content all happen elsewhere. And the redirects only work while the old domain and its hosting stay alive; let either lapse and the instructions vanish with them.
Common mistakes
- Deploying the rules on the new domain. A flawless file on the new host never sees a request sent to the old one.
- Using 302 out of caution. A domain change is not a trial. Temporary codes tell search engines to keep the old address in mind, the opposite of a move.
- Sending every old path to the new home page. Path-to-path rows take longer to write and are worth it. One blanket destination throws away the value of the old pages.
- Skipping the manual test. Shape validation cannot catch a rule that points at a missing page. Click every old URL.
- Letting the old domain expire. The redirect list is only as durable as the registration and hosting behind it.
FAQs
Which status code should a domain change use? 301, on every row. A domain change is a permanent move, and 301 is the code that says the old address has retired and the new one replaces it. A temporary code such as 302 sends a mixed signal for as long as the rules stay up.
Where do the redirect rules for a domain change live? On the old domain's hosting. The rules only fire where the old URLs are answered. So a perfect rule file sitting on the new domain does nothing for visitors who arrive at the old one.
Can the generator move my whole domain with one rule? No. The generator builds per-path rules from the rows you enter. A blanket rule sends every old path to the same path on the new domain. It is a single server-level line you write yourself in the same file.
What happens if I enter the same from path twice? The tool refuses it. A duplicate from-path would leave two rules competing for the same old address. So the generator makes you delete or merge the extra row instead of emitting both.
Is my redirect plan uploaded anywhere? No. The generator runs entirely in your browser and the rules are produced on your device. Nothing you type into it leaves the page.
Conclusion
A domain change succeeds when the old addresses keep answering. One 301 row per important path, written with the Redirect Rule Generator, covers the move honestly. Export the rows in the format the old host reads, and test them path by path. You may be unsure which of the three output formats your server wants. Our comparison of htaccess vs Nginx redirect syntax walks through what changes between them. For more guides in this series, see our Website and Webmaster Tools guides.
References
- MDN Web Docs, on HTTP redirections and the status codes that describe them: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Redirections
- Google Search Central, on moving a site with URL changes: https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes