Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Proposal] Remove the trailing slash in URL #58

Copy link
Copy link
Closed
@bpierre

Description

@bpierre
Issue body actions

With the following URLs:

http://myapp.dev/admin
http://myapp.dev/admin/users

I can’t “hack” the URL by removing the users part of the second one, a 404 will be triggered because of the trailing slash:

http://myapp.dev/admin/

I think that “hackable URLs” are a nice way to interact with an application.

Proposal

The Router class could handle this: if a route is not matched, but the path ends with a slash, then try again to match the route after removing the trailing slash.

If the route exists, then redirect to the correct route, without trailing slash. Or maybe don’t even redirect, like GitHub does (it could be a setting):

https://github.com/laravel/framework/issues
https://github.com/laravel/framework/issues/

Router->dispatch() could handle this, or maybe Router->handleRoutingException().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.