• Resolved afshinmoshrefi

    (@afshinmoshrefi)


    I have used reactpress for over a year successfully – the integration is seamless into wordpress and works very well.

    I’m working on a feature where I need to pass some data on the querystring to the react app. I developed it in dev mode and it worked as expected.
    when I try to use the compiled version, I get a 404 not found error. Is there anyway I can use querystring with reactpress? I am not using a router.

    latest info – This problem seems to be happening only to my staging. It is working as expected on dev and prod –

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter afshinmoshrefi

    (@afshinmoshrefi)

    I have done a lot more testing – the problem is intermittent. I haven’t found a pattern yet. Occationally query string seems to work fine. Other times wordpress returns 404 not found.

    The problem doesn’t seem to be with my code – when the react app is found, it works fine.

    Plugin Author rockiger

    (@rockiger)

    Hm, this could be something I missed. Could you post an example of the querystring? Did you try to activate the routing option for your app?

    The WordPress routing is pretty complex. I need to look into it, to see how it works.

    Thread Starter afshinmoshrefi

    (@afshinmoshrefi)

    I was trying to pass 5 parameters on the querystring. the problem was that sometimes wordpress would return 404 – not sure what the pattern was.

    for reasons I don’t understand when I pass 1 parameter in the querystring all seems to work:
    https://mywebsite/myreactpage?o=long_string_param

    I’ve got it to work now by only passing 1 long string parameter and spliting it in react.

    what I want to do is to pass the parameter with a / seperator
    https://mywebsite/myreactpage/long_string_param

    in the above case, wordpress throws a 404 everytime

    Plugin Author rockiger

    (@rockiger)

    Hm, it seems this is some weird behavior on WordPress’s part.

    I have two ideas:

    1. If you don’t need any subpages to your app, activate client-side in the ReactPress admin. Even if you don’t use some routing library. It tells WordPress to ignore the URL part after the permalink to the page.
    2. Use a # before your parameters. Everything what comes after is ignored, because the browser think it is an anchor.

    Hope this helps

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘page with querystring is not found’ is closed to new replies.