Skip to content

Conversation

@alexdln
Copy link
Contributor

@alexdln alexdln commented Feb 1, 2026

Trailing slash setup. For example I often visit a page with a slash in the end and see a 404 error, even though the package exists. Now it will redirect.

I did this using vercel config. I'm a little concerned that this approach won't work during local development, but it seems better than leaving things as they are. Any better ideas would be appreciated [if needed]

Closes #648

@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 1, 2026 3:40pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 1, 2026 3:40pm
npmx-lunaria Ignored Ignored Feb 1, 2026 3:40pm

Request Review

Copy link
Collaborator

@43081j 43081j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does work, so seems like a good change to me

to get it to work in dev, we'd need to configure nuxt's router.options.strict to false i think, but that seems to break other things. so for now, maybe we just don't bother in dev and figure it out in a separate PR

@danielroe
Copy link
Member

this is good

we can also add a global route middleware, dev only, which redirects

@alexdln
Copy link
Contributor Author

alexdln commented Feb 1, 2026

@danielroe
Does it make sense for us to do different approaches for dev and prod? Or should we always redirect through middleware?

@danielroe
Copy link
Member

it'll be more performant to do the cdn-level redirect as opposed to middleware

@alexdln
Copy link
Contributor Author

alexdln commented Feb 1, 2026

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure trailing slash redirects

3 participants