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

Getting 404 page when query params are present and routing is set to path on root route #92

Open
JRJurman opened this issue Oct 30, 2019 · 5 comments
Labels

Comments

@JRJurman
Copy link

Summary

I've noticed for my site (and the docma site) that query parameters are not ignored if they are included at the end of a path - even though the routing is set to work with the path.

For example, instead of ignoring (or removing) the query param, the page for https://onury.io/docma/?example shows a 404 page.

image

When advertising or posting on sites like Facebook, they can automatically include query params, so being able to ignore these would be super valuable.

@JRJurman
Copy link
Author

JRJurman commented Oct 30, 2019

On some investigation, it looks like it's coming from these lines
https://github.com/onury/docma/blob/master/lib/web/DocmaWeb-SPA.js#L96-L102

I'm willing to make a PR for the change, but the way this is written, it appears intentional. Eager to hear feedback if a PR to change this would be accepted.

@JRJurman JRJurman changed the title Getting 404 page when query params are present and routing is set to path Getting 404 page when query params are present and routing is set to path on root route Oct 30, 2019
@JRJurman
Copy link
Author

After doing some more investigation, it appears this issue only occurs on the root route. This can be seen on the docma website as well, if you append a query parameter to the api page
https://onury.io/docma/api/?example

@onury
Copy link
Owner

onury commented Jan 22, 2020

@JRJurman sorry for the late reply.

How and what does facebook append as query-string? That's weird.

And yes that's intentional (see this line) because same URL with a query-string actually is a different resource. If not serving it, should render 404, IMO.

@JRJurman
Copy link
Author

JRJurman commented Jan 24, 2020

@onury when just posting the url for my site in a facebook post, this is the query parameter attached
https://tram-one.io/?fbclid=IwAR0FMuUr86D50D15rjYCH8jMm1D8C36BtOE9nszTeZsEFOAmBVgLKUK0lTE

There's also a set of default query params that are attached when creating Facebook ads. Facebook will actually reject the ad because the url resolves as a 404 (with no page content). The query params there are more complicated, but mostly (probably) for tracking. Looking now it appears those can be removed in the ad configuration, but that still doesn't resolve the facebook post issue.

@onury
Copy link
Owner

onury commented Jan 24, 2020

Ok. Thanks for the info. I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants