-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Redirect URLs with a Trailing Slash option #26207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This doc PR should be considered too: symfony/symfony-docs#9286 |
See #26059 (comment) |
@Tobion so can we agree on doing this in symfony ? |
yes I'm in favor of doing it |
See #26283 |
Tobion
added a commit
that referenced
this issue
Feb 24, 2018
…n possible (nicolas-grekas) This PR was merged into the 4.1-dev branch. Discussion ---------- [Routing] Redirect from trailing slash to no-slash when possible | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26207 | License | MIT | Doc PR | - Implemented as suggest by @Tobion in #26059 (comment) When a route for `/foo` exists but the request is for `/foo/`, we now redirect. (this complements the flipped side redirection, which already exists.) Commits ------- 69a4e94 [Routing] Redirect from trailing slash to no-slash when possible
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On a classic Symfony setup, if we have a route with
/en/blog
url, we will get a 404 error if we try/en/blog/
.The documentation well explains how to handle that: https://symfony.com/doc/current/routing/redirect_trailing_slash.html
But I think it's a very common issue.
Why not proposing this as an option (IMHO, it should be activated by default) instead of telling the user to always write the same code? Reuse code is better than rewriting it. 👍
Of course, we may create a bundle instead. But I think this feature has his place on the internal Symfony codebase.
The text was updated successfully, but these errors were encountered: