benawad / dogehouse

Taking voice conversations to the moon 🚀
https://dogehouse.tv/
MIT License
9.12k stars 1.48k forks source link

Remove the 404 page and use the Redirects feature instead #2811

Closed chalkedgoose closed 3 years ago

chalkedgoose commented 3 years ago

Is your feature request related to a problem? Please describe. dogehouse/kibbeh/src/pages/404.tsx is redundant since we don't have a 404 page it is a simple redirect. We should instead use the Redirects feature built into the Next by modifying next.config.js This should significantly speed up redirects and send a 301 redirect response code to browsers.

module.exports = {
  ...,
  async redirects() {
    return [
      {
        source: '/404',
        destination: '/',
        permanent: true,
      },
    ]
  },
}
chalkedgoose commented 3 years ago

@overlisted @amitojsingh366

chalkedgoose commented 3 years ago

can you do it yourself

@overlisted I could do it myself but it will be a while due to my day job. And I also wanted feedback/validation on this approach to the 404 redirect.

rocktimsaikia commented 3 years ago

@overlisted Can I take this?

amitojsingh366 commented 3 years ago

@overlisted Can I take this?

go ahead

amitojsingh366 commented 3 years ago

@chalkedgoose i tried it and unfortunately it seems like you cannot turn a 404 to a 301. it will have to go through pages/404.tsx and then redirected to /dash

amitojsingh366 commented 3 years ago

and looking at it again i don't see why we would want to turn a 404 into a 301

chalkedgoose commented 3 years ago

and looking at it again i don't see why we would want to turn a 404 into a 301

@amitojsingh366 The reason you'd want to do it is that your essentially utilizing the page as a 301 redirect anyways. There's just no status code and a client side redirect.