Skip to content

Start - Redirect paths containing a trailing slash (e.g. /foo/ -> /foo) #3798

@jasongitmail

Description

@jasongitmail

Which project does this relate to?

Start

Describe the bug

For SEO, so only one valid, canonical path returns 200.

Your Example Website or App

https://tanstack-start.pages.dev/posts/

Steps to Reproduce the Bug or Issue

Create /routes/about.jsx and visit /about/ using dev server or production build. It will return the path, but should redirect to /about.

Example here (but I don't know their TanStack-related versions bc this one isn't my app, but it's shareable):
https://tanstack-start.pages.dev/posts/

Expected behavior

.

Screenshots or Videos

No response

Platform

Versions for my app, which shows this behavior too.

    "@tanstack/react-query": "^5.68.0",
    "@tanstack/react-router": "^1.114.23",
    "@tanstack/react-router-with-query": "^1.114.23",
    "@tanstack/react-start": "^1.114.23",

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions