Skip to content

Fix trailing slashes with an edge function #1448

Closed
@MarcL

Description

@MarcL

By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash. For example /about/ will redirect to /about. This has caused issues (see below).

@ascorbic created a proof of concept to add or remove trailing slashes in an edge function. This can be used to enable or disabled trailing slashes based upon the Next.js configuration.

Documentation

https://github.com/ascorbic/slash-edge
https://nextjs.org/docs/api-reference/next.config.js/trailing-slash

Related Issues

#1329
#998
#1144
#1788

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: featurecode contributing to the implementation of a feature and/or user facing functionalityv4Issues related to the v4 Next.js runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions