How to add 301 redirects for a NuxtJS website deployed on Netlify

Netlify
NuxtJS

  • Dani Dean
  • 3rd Nov 2021

I had recently been trying to add a couple of redirects on a NuxtJS website and after trying a couple of different methods I found one that successfully worked.

You can simply achieve this by adding a Netlify configuration file to the root of your project which is a netlify.toml. You can find more information from this link to the Netlify documentation: https://docs.netlify.com/routing/redirects/#syntax-for-the-netlify-configuration-file

You can add a simple 301 redirects to the file by adding the following:

[[redirects]]
  from = "/web-design"
  to = "/"
  status = 301

[[redirects]]
  from = "/support"
  to = "/contact/"
  status = 301
Back to Blogs