Can the redirection status code of the trailing slashes be modified? 308 = > 301
Unanswered
Air Penguin posted this in #help-forum
Can the redirection status code of the trailing slashes be modified? 308 = > 301
8 Replies
Kurilian Bobtail
One way is to disable automatic trailing slash redirection https://nextjs.org/docs/app/api-reference/next-config-js/trailingSlash and then do it manually via routing middleware https://nextjs.org/docs/app/building-your-application/routing/middleware
@Air Penguin Can the redirection status code of the trailing slashes be modified? 308 = > 301
why do you want it to be 301 tho?
308 is better in basically every way (ie if method is POST it stays post instead of turning into GET)
I'm sorry, I just saw your response,
My seo team thinks 301 is friendly
My seo team thinks 301 is friendly
@Kurilian Bobtail One way is to disable automatic trailing slash redirection https://nextjs.org/docs/app/api-reference/next-config-js/trailingSlash and then do it manually via routing middleware https://nextjs.org/docs/app/building-your-application/routing/middleware
I'm going to try to customize the handling of tail slashes in the middleware,thanks you!
@Air Penguin I'm sorry, I just saw your response,
My seo team thinks 301 is friendly
Well you can tell them to do some more research as google and others treat them the same (as long as both permeant) - I think it's just 301 is more known and talked about
@riský Well you can tell them to do some more research as google and others treat them the same (as long as both permeant) - I think it's just 301 is more known and talked about
Yes! I will keep in touch with my seo team on the selection of 301 and 308.
Thank you very much. I have two options. I feel like I can go in and go out,lol
Thank you very much. I have two options. I feel like I can go in and go out,lol
@Air Penguin I'm sorry, I just saw your response,
My seo team thinks 301 is friendly
Kurilian Bobtail
301 is friendly compared to 302 (tells google to transfer juice from one url to the other, being permanent.) 308 and 307 are the better counter part, as @riský is advising you. so yeah push against that request because the year is 2024