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

Adding parameter to root URL cause a 404 #1436

Closed
saxinte opened this issue Apr 18, 2017 · 5 comments
Closed

Adding parameter to root URL cause a 404 #1436

saxinte opened this issue Apr 18, 2017 · 5 comments
Labels

Comments

@saxinte
Copy link

saxinte commented Apr 18, 2017

Tested with Grav: 1.2.2
Platform: OSX El Capitan 10.11.6
Setup is the following one: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

Hi, using a new instance of Grav with multi language setup, there is a 404 when adding parameters on the root page only.

Here is how to replicate:

  • Download a last Grav Instance.
  • Create a new page called my-page.
  • Add to /grav/user/config/system.yaml the following lines to enable multi-lang setup:
languages:
  translations: true
  supported:
    - en

Then, try to fetch the following URLs:

  • /en > 200
  • /my-page > 200
  • /en?foo > 404
  • /my-page?foo > 200

I also created a video to demonstrate the issue: https://streamable.com/g411p

Thanks

@flaviocopes
Copy link
Contributor

/en is not a page, so it's triggering the "page not found" error unless it has no other arguments and it's considered to be a language identifier.

/en?foo does not work, but /en/?foo works

@saxinte
Copy link
Author

saxinte commented Apr 20, 2017

Hi @flaviocopes thanks for your answer :)

Unfortunately I'm afraid that this behaviour is wrong and Grav should handle that anyway.
There is plenty of cases where I should be able to call my app using query parameters.
Current website is: https://www.busuu.com/fr

Because of that I can't use Google PPC (or Adwords). Google is adding some parameters on the current URL, like: https://www.busuu.com/fr?b_source=adwords&b_campaign=uk_en_web_brand_e

This doesn't work and as you explained and returns a 404.
I would like also to call that URL using other parameters, like https://www.busuu.com/fr?destination=another_URL, I can't do that either.

If I'm using Optimizely for A/B testing, Optimizely also adds some parameters to the URL, and it returns a 404, I don't have any control on how those tools add parameters unfortunately.

I really think Grav should be able to handle it, what's your thoughts on that?

Thanks,
Seb

@rhukster
Copy link
Member

Please try my fix as it should resolve the issue.

@rhukster rhukster added the fixed label Apr 20, 2017
@saxinte
Copy link
Author

saxinte commented Apr 24, 2017

Hi @rhukster , thanks, I'll try it asap.

@saxinte saxinte closed this as completed Apr 25, 2017
@saxinte
Copy link
Author

saxinte commented Apr 25, 2017

@rhukster Thanks, tested and working properly. Really appreciated!

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

3 participants