Force Trailing slashes - 301 redirect

Hey! Im trying to redirect links without trailing slash to links with trailing slashes at the end, currently on static generated site pages are available both at - for example /events and /events/. This may cause some SEO issues I’m trying to fix, also I’m using Nuxt to generate static page with router trailing slash setting set to true, so on render, pages without trailing slashes are opened but not everything works.
Is there any way to force all pages to 301 redirect to trailing slash pages? I found similiar thread:
but it was in 2020 and I don’t know if anything changed.
I tried to add redirect like this: /:a to /:a/ but sometimes this causes infinite redirect loops.


As you found, trailing slash configuration is still a feature request and not currently configurable. Please feel free to upvote/comment on it to be notified of any updates.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.