Skip to content
Meneer Marketing, to homeNederlands
Nederlands

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.

12 min readKVK 42095913, based in Apeldoorn (Gelderland)

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.

CodeTypeWhat Google does with itWhere you come across it
301PermanentThe new address becomes the address in the search resultsApache and Netlify, in my tool's rules
308PermanentThe same signal as a 301Vercel and Next.js when permanent is true
302TemporaryThe old address stays in the search resultsApache if you do not give a code
307TemporaryThe same signal as a 302Vercel 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 addressNew addressWhy
/team.html/over-mijSame topic, different name
/knippen-dames/behandelingen/knippenThe page has moved into a folder
/nieuws/2019/openingsfeestno new pageA 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 pasteWhat the tool does
An old address with https:// and a domain in frontRemoves the domain and keeps the path, such as /team.html
An old address with a question markUses only the part before the question mark and reports that
A slash at the end of an old addressRemoves 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 twiceUses the first line and reports it
An address that points to itselfSkips the line and reports it
A new address that is itself an old addressReports 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.

PlatformWhere you put itThe first line of the exampleStatus code
Vercelvercel.json, field redirectssource /team.html, destination /over-mij, permanent true308
Next.jsnext.config.js, function redirectssource /team.html, destination /over-mij, permanent true308
ShopifyImport a CSV at URL redirects/team.html,/over-mij under the header Redirect from,Redirect toThe help page does not mention it
Apache.htaccess or the server configurationRedirect 301 /team.html /over-mij301
Netlify_redirects in the folder you publish/team.html /over-mij 301301

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.

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 seeWhat it meansWhat you do
308 or 301 with a Location to the new addressThe redirect is permanentGo to the next address
302 or 307The redirect is temporary, so Google keeps the old address in the resultsSet it to permanent
Two redirects in a rowA chainSend the old address directly to the final destination
200 on the old addressThe redirect does not step in, for example because the old page still existsRemove the old page in Shopify, or force the rule in Netlify
404 on the new addressThe new address does not exist, often because of a typoCorrect 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

Frequently asked questions on this topic

What is a 301 redirect?
A 301 is a permanent redirect: the server says that a page has moved to another address for good. Google then shows the new address in the search results. Google counts 301 and 308 as permanent and 302, 303 and 307 as temporary. Bing writes that you use 301 for permanent changes and 302 only for very short changes of less than two days.
What is the difference between a 301 and a 308?
For Google there is no difference, because both count as a permanent redirect. The difference is in the method: Next.js explains that with a 301 or 302 many browsers turned a request into a GET, and that 307 and 308 keep the original method. Vercel and Next.js give a 308 when permanent is set to true. Apache and Netlify give a 301 in the rules from my tool.
How do I make a 301 redirect in Vercel?
Put a list of redirects in vercel.json in the root folder of your project, with a source, a destination and permanent set to true for each redirect. Vercel writes that this gives a 308 and that such a list holds a maximum of 2,048 redirects. Then deploy again and test a few addresses with curl -I. My tool makes these rules from your list of old and new addresses.
How do I make redirects in Shopify with a CSV?
Save the rules in a CSV with the header Redirect from,Redirect to, as in Shopify's example file, and import it under Content, Menus, URL redirects, Import. Shopify writes that you can only redirect from addresses that give an error and that the maximum is 100,000 redirects. If an old address still loads a page, the redirect does not work.
How long should a 301 redirect stay in place?
Google writes that you should leave redirects in place for as long as possible, as a rule at least a year. That gives Google time to transfer all the signals, including for links from other sites to your old addresses. For visitors you can leave them in place indefinitely, according to Google, but redirects are slow for users, so update your own links to the new addresses.
May I send all old addresses to my homepage?
Preferably not. 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, because that can confuse users and can count as a soft 404. If you have combined the content of several pages into one new page, the old addresses may go there. Send the rest to the page with the same topic.
What is a chain of redirects and why is it bad?
A chain is an old address that goes to a second address that itself redirects again. Google writes that Googlebot can follow up to 10 steps, but advises sending directly to the final destination. If that does not work, keep the chain short, preferably no more than 3 and fewer than 5 steps. A chain slows visitors down and not every browser supports long chains.
Does a redirect work if the old page is still online?
That depends on your platform. Shopify writes that a redirect only works from an address that gives an error. With Netlify the redirect does not happen if there is a file at that address, unless you put an exclamation mark after the code. Next.js, on the other hand, checks redirects before the file system, so there the redirect wins over a page in your project.
Do I need to submit an address change in Search Console?
Only if you move to another domain or subdomain. Google writes that you do not need the address change 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. In those cases you redirect the addresses permanently and submit a new sitemap.
How do I test whether my redirects work?
Use curl -IL followed by the old address. You then see the status code and the Location line of every step, including in a chain. Google mentions the URL Inspection tool in Search Console for single addresses and command-line tools or scripts for large numbers. Do not check only in your browser, because a browser can store a permanent redirect.
What do I do with an old address without a new page?
Let it give a real 404 and do not send it to the homepage. Bing writes that for permanently removed content you return a 404 and report changed or removed addresses through IndexNow. Google calls a redirect to an address that is not a good fit a possible soft 404. My own rule is that an unknown page gets a real 404.
What does it cost if you handle the redirects?
With a new site, 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. The amounts are on the prices page. Send me a message with the address of your old site.

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 answer
  • When 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 answer
  • Why 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
All questions and answers
I am on Instagram tooThat is where I show what I build and what works, in short posts and reels.@meneermarketingBack to the knowledge base