Skip to content
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

Trailing slash and query string returns 404 #3469

Closed
mikemartin opened this issue Apr 2, 2021 · 2 comments · Fixed by #3494
Closed

Trailing slash and query string returns 404 #3469

mikemartin opened this issue Apr 2, 2021 · 2 comments · Fixed by #3494

Comments

@mikemartin
Copy link

mikemartin commented Apr 2, 2021

Bug Description

It appears that appending urls with a trailing slash and a query string produces a 404 error.

How to Reproduce

  • Visit /slug/?foo=bar
  • See 404 page error

Extra Detail

Environment

Statamic 3.0.49 Pro
Laravel 7.28.3
PHP 7.4.14
aryehraber/statamic-font-awesome 2.0.0
doublethreedigital/duplicator 1.1.0
rias/statamic-color-swatches 2.0.5
rias/statamic-redirect 1.2.0
statamic/seo-pro 2.0.14

@jasonvarga
Copy link
Member

Happens without static caching.

@mikemartin mikemartin changed the title Trailing slash and query string returns 404 when using static caching Trailing slash and query string returns 404 Apr 3, 2021
@jasonvarga
Copy link
Member

Note to self: it's because Data::findByUri ends up getting a $uri ending with /, which is wrong. We'll need to strip that off.

if ($data = Data::findByUri($url, Site::current()->handle())) {

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 a pull request may close this issue.

3 participants