Building
301 redirects for a new website: paste your list, get the rules
A new website without redirects costs you visitors. Paste a list of old and new addresses and get the rules for Vercel, Next.js, Shopify, Apache or Netlify.
A visitor who follows the old address of your site after a move, from Google, from an email or from another site, lands on an error message if you do nothing. A redirect sends them to the new page. On a new domain, my check script reported that the bare domain forwarded temporarily (307) to www, and I change that to permanent (308). For every address that got visits or links, I make a redirect to the closest new page.
What is the difference between a 301, 302, 307 and 308?
Google sorts redirects into two types. On the page about redirects, which I read on 20 November 2026, it says that a permanent redirect shows the new address in the search results and a temporary one shows the old address. Google counts 301 and 308 as permanent and 302, 303 and 307 as temporary.
| Code | Type | What Google does with it | Where you come across it |
|---|---|---|---|
| 301 | Permanent | The new address becomes the address in the search results | Apache and Netlify, in my tool's rules |
| 308 | Permanent | The same signal as a 301 | Vercel and Next.js when permanent is true |
| 302 | Temporary | The old address stays in the search results | Apache if you do not give a code |
| 307 | Temporary | The same signal as a 302 | Vercel and Next.js when permanent is false |
Google writes that users usually do not notice the difference between the types. Next.js explains in its documentation why it uses 307 and 308: with a 301 or 302, many browsers turned the request into a GET, even if it was a POST, and 307 and 308 keep the method that the visitor used. For Google, 301 and 308 both count as permanent.
Bing writes in its guidelines for webmasters, which I read on 20 November 2026, that you use 301 for permanent changes and 302 only for very short changes, of less than two days. Bing also says that you use redirects instead of canonical tags when content moves.
Google prefers a redirect from the server. A meta refresh and JavaScript are lower on its list, and Google only mentions a redirect with JavaScript if you cannot do anything else.
How do you make the list of old addresses?
Start with the addresses that got visits or links, because that is where the value is. You find them in four sources.
- The sitemap of your old site, if it is still there.
- Search Console. In its explanation about moving, Google writes that you keep a list of the sites that link to your old addresses, and that you find those links in Search Console.
- Your statistics, for the pages that got visits.
- The web archive at archive.org if the old site is already gone. This is how I fetch the addresses: the CDX command of the web archive returns addresses, status codes and dates.
Next to every old address, put the new page on the same topic. On the page about moving to new addresses, which I read on 20 November 2026, Google writes that you should not send many old addresses to one address that is not a good fit, such as the homepage of the new site. That can confuse users and can count as a soft 404, a page that exists but has nothing to offer. If you have combined the content of several pages into one new page, the old addresses may go there.
Example: a made-up hair salon with a new site. This is what a list looks like, with the reason next to each address.
| Old address | New address | Why |
|---|---|---|
| /team.html | /over-mij | Same topic, different name |
| /knippen-dames | /behandelingen/knippen | The page has moved into a folder |
| /nieuws/2019/openingsfeest | no new page | A real 404 is more honest than a redirect to the homepage |
What does the tool make of your list?
On each line you paste an old and a new address, separated by a space, comma, semicolon, tab or arrow. The tool skips a line that starts with a hash sign. You get the rules for five platforms, each with a copy button, and a warning for duplicate lines, an address that points to itself, and chains. What you paste stays in your browser.
This is how the tool treats what you paste:
| What you paste | What the tool does |
|---|---|
| An old address with https:// and a domain in front | Removes the domain and keeps the path, such as /team.html |
| An old address with a question mark | Uses only the part before the question mark and reports that |
| A slash at the end of an old address | Removes it and reports that. Check with your platform whether an address with and without a slash is the same |
| A new address with https:// | Keeps the full address, handy for another domain |
| An old address that appears twice | Uses the first line and reports it |
| An address that points to itself | Skips the line and reports it |
| A new address that is itself an old address | Reports the chain and says which address you can use directly |
The warning about chains is the most important one. Google writes that Googlebot can follow up to 10 steps in a chain, but advises sending directly to the final destination. A chain slows visitors down, and not every browser supports long chains.
Where do you put the rules, and which status code do you get?
Each platform has its own place and its own default. I read the documentation of Vercel, Next.js, Shopify, Apache and Netlify on 20 November 2026.
| Platform | Where you put it | The first line of the example | Status code |
|---|---|---|---|
| Vercel | vercel.json, field redirects | source /team.html, destination /over-mij, permanent true | 308 |
| Next.js | next.config.js, function redirects | source /team.html, destination /over-mij, permanent true | 308 |
| Shopify | Import a CSV at URL redirects | /team.html,/over-mij under the header Redirect from,Redirect to | The help page does not mention it |
| Apache | .htaccess or the server configuration | Redirect 301 /team.html /over-mij | 301 |
| Netlify | _redirects in the folder you publish | /team.html /over-mij 301 | 301 |
Vercel
Put the rules in vercel.json in the root folder of your project, in the field redirects. If a list is already there, add them to that list. On the page about redirects in the configuration Vercel writes that these rules are fixed at build time, so after a change you deploy again. According to Vercel, permanent set to true gives a 308 and permanent set to false gives a 307. A list in vercel.json may contain at most 2,048 redirects. If you have more, Vercel mentions Bulk Redirects for Pro and Enterprise teams, and a function as an alternative for the Hobby plan.
The source only matches the path and not the part after the question mark. For an old address with a query parameter you need a condition of the type query, and my tool does not make that. Paths are case-sensitive: Vercel treats /About and /about as two addresses.
Next.js
Put the rules in next.config.js in the function redirects, next to your other settings. Next.js writes that permanent set to true gives a 308, which clients and search engines keep forever, and that false gives a 307. Redirects are checked before Next.js looks at the file system, so also for a page in your project and for files in public. The characters ( ) { } : * + ? are pattern characters. If such a character appears literally in an old address, you put two backslashes in front of it in the code, Next.js writes. Query parameters in the request are passed on to the new address.
Shopify
Save the rules as a CSV file and import them in your admin under Content, Menus, URL redirects and Import. The first line of the file is Redirect from,Redirect to, as in the example file that Shopify offers on its help page. Shopify writes that you can only redirect from addresses that give an error: if the old address still loads a page, the redirect does not work. The maximum is 100,000 redirects. You cannot redirect addresses that start with /cart, /orders or /apps, and addresses with a query string may behave unexpectedly. A redirect also applies to the language and market folders of your shop.
Which status code a redirect gives is not on that page. The page mentions 301 only where it talks about browsers and search engines storing redirects, so test with curl what your shop returns. Google itself writes that a platform like Shopify often already has its own solution for redirects. How I approach this when moving from WooCommerce is in from WooCommerce to Shopify or your own code.
Apache
Put the rules in the .htaccess file of your site or in the server configuration. In the mod_alias documentation it says that a Redirect without a status code is temporary (302). With 301 or permanent in it, it is permanent, and my rules have 301. Apache forwards every request that starts with the old path and sticks whatever follows it onto the new address: /oud/pagina therefore goes to /nieuw/pagina. If you do not want that, test the addresses below the old path separately. For more complicated rules Google mentions mod_rewrite.
Netlify
Put the rules in a text file named _redirects, without an extension, in the folder you publish, or in your configuration file netlify.toml. On the options page Netlify writes that the status code is 301 if you do not give one. According to the overview of redirects, Netlify reads the rules from top to bottom and the first line that matches wins, and paths are case-sensitive. If there is still a file at the old address, the redirect does not happen, unless you put an exclamation mark after the code (301!). If you have 10,000 redirects or more, Netlify recommends using as many wildcards or placeholders as possible.
How long do you leave redirects in place?
Google writes that you should leave redirects in place for as long as possible, as a rule at least a year. Google needs that time to transfer all the signals, including for links from other sites to your old addresses. Seen from your visitors, you can leave them in place indefinitely, according to Google, but redirects are slow for users. So update your own links, and have the sites that link to you a lot point to the new addresses.
What do you do with your links and your sitemap?
For the new pages, Google advises, among other things, that every page has a canonical that points to itself, that you change the internal links from the old to the new addresses and that you submit a sitemap with the new addresses in Search Console. The old sitemap can then go. If your site has several languages with hreflang, update those references to the new addresses as well. How hreflang works, you can read in setting up hreflang for a bilingual website.
My check script reports sitemap addresses that redirect, because the sitemap should contain the final destination. Bing recommends IndexNow to report added, updated and removed addresses. How that works is in setting up Bing Webmaster Tools and IndexNow.
If your domain name or subdomain changes, Google says you submit an address change in Search Console. For a move from http to https, a switch between www and non-www on the same domain, or a move of paths within the same domain, that is not needed.
How do you test whether the redirects work?
Google mentions the URL Inspection tool in Search Console for single addresses and command-line tools or scripts for large numbers. With curl -I followed by the old address you fetch only the header of the response: the status code and the Location line with the new address. Add an L, so curl -IL, and curl follows the redirect and shows every step, including a chain. The curl manual, which I read on 20 November 2026, describes -I as fetching only the headers and -L as repeating the request at the new location. Vercel lists 301 and 308 as stored by the client. A browser can therefore remember a permanent redirect, and that is why you also check with curl.
| What you see | What it means | What you do |
|---|---|---|
| 308 or 301 with a Location to the new address | The redirect is permanent | Go to the next address |
| 302 or 307 | The redirect is temporary, so Google keeps the old address in the results | Set it to permanent |
| Two redirects in a row | A chain | Send the old address directly to the final destination |
| 200 on the old address | The redirect does not step in, for example because the old page still exists | Remove the old page in Shopify, or force the rule in Netlify |
| 404 on the new address | The new address does not exist, often because of a typo | Correct the address in your list |
What do you do with an address without a successor?
Let it give a real 404. Bing writes in its guidelines that for permanently removed content you return a 404, use Bing's removal tools where needed and report changed or removed addresses through IndexNow. Google calls a redirect of many old addresses to one address that is not a good fit a possible soft 404. My own rule is that an unknown page gives a real 404. That check is in the checklist for going live.
When I help with this
If you have your site redone, mapping your addresses, setting up the redirects and testing in advance are part of my work. A website with your own code starts at €1,400 one-off and a subscription with website starts at €179 per month, all excluding VAT. Send me a message with the address of your old site. I usually reply within 2 hours, seven days a week, and you get a proposal with a price within one working day.
You can read when redoing your site makes sense in when should you redo your website, and what to give a builder in the briefing for a web builder. Outgrown your WordPress theme is about a site on WordPress that grows into a site with its own code. What I build is on web development, and the amounts are on prices.
Sources
- the page about redirectsdevelopers.google.com
- its documentationnextjs.org
- guidelines for webmastersbing.com
- the page about moving to new addressesdevelopers.google.com
- the page about redirects in the configurationvercel.com
- its help pagehelp.shopify.com
- the mod_alias documentationhttpd.apache.org
- the options pagedocs.netlify.com
- the overview of redirectsdocs.netlify.com
- The curl manualcurl.se
- Vercelvercel.com
Frequently asked questions on this topic
What is a 301 redirect?
What is the difference between a 301 and a 308?
How do I make a 301 redirect in Vercel?
How do I make redirects in Shopify with a CSV?
How long should a 301 redirect stay in place?
May I send all old addresses to my homepage?
What is a chain of redirects and why is it bad?
Does a redirect work if the old page is still online?
Do I need to submit an address change in Search Console?
How do I test whether my redirects work?
What do I do with an old address without a new page?
What does it cost if you handle the redirects?
Apply this article to your situation?
In a conversation I turn this kind of insight into concrete priorities for your channels and your site.
Questions about this topic
Short and detailed answers to the questions that go with this.
How long does it take to have a website built?
How long it takes to have a website built depends on the size, on when text and images are ready, on how quickly feedback comes in and on the features and integrations that go with it.
Read the answerWhen should you redesign your website?
Redesign your website if it is slow on a phone, hard to read or change, brings in no enquiries or can no longer be updated safely. If only one part is the problem, improve that first.
Read the answerWhy is my website not in Google?
A website is usually not in Google because Google has not come across the page yet, is not allowed to read it, is not allowed to include it, or read it and did not find it good enough.
Read the answer



