Reasoning behind 308 redirects when trailingSlash: true #15432
-
👋 I just upgraded the latest canary build for 9.4.5 and I noticed that I'd like to know what's the reasoning behind using a 308 for those redirects and not a 301, or even let the consumer decide what kind of redirect they want to use to remove/persist the trailing slash. My guess is that this isn't configurable because of time constrains, if that's the case, maybe I can give you a hand with that? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
This was intentional given that |
Beta Was this translation helpful? Give feedback.
-
Even though 308 is definitely the appropriate status code to use technically, unfortunately for us at least, Google doesn't seem to index 308 as permanent despite various online threads on twitter and in blog posts. We turned on We're going to workaround this via nginx most likely to force these to be 301s instead and see how search console reacts. Search console may be wrong because it doesn't have a way to show 308s in the console maybe but in that case I'd expect it instead to show them as permanent 301s if it were treating them as such? I realize this isn't a nextjs bug hence no new issue but it would be great to be able to configure this redirect until such time that google publicly and directly supports 308. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello, adding my input on this one. I also think it should be great to be able to configure the status code when redirecting (301 or 308, 302 or 307), because I'm not 100% sure the two work exactly the same SEO-wise (not sure they transfer the same SEO juice/weight, backlinks, etc). We're using only GET requests, and our SEO agency has asked us several times to go back to 301 redirects. Would you consider adding an option for this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
We have a very high Google ranking for a few pages and this 308 redirect is hurting us a bit having migrated to NextJS+Vercel because it's indexing trailing / as duplicate pages. Is there a solution for this ? I'm going to look at patching wherever this is happening, presumably in the next node module somewhere. |
Beta Was this translation helpful? Give feedback.
-
Any updates here? |
Beta Was this translation helpful? Give feedback.
This was intentional given that
308
is the correct status code to use nowadays, see the documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308. 301 has some flaws like form data not going through.