Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author John Godley

    (@johnny5)

    The redirect doesn’t make a lot of sense. You are matching a URL with parameters and trying to pass it through to the same URL without parameters. Why? The title doesn’t really make sense.

    Does the target page itself work?

    Thread Starter Nazrinn

    (@nazrinn)

    Yes it works without any issues.

    I’m trying to pass the URL with query parameters to this page because the page is using client-side rendering. You can see a live, but watered-down version of this page here. Redirections have no issues there thanks to your plugin.

    Plugin Author John Godley

    (@johnny5)

    That doesn’t seem like something you need to do.

    If everything is working fine then what is your question?

    Thread Starter Nazrinn

    (@nazrinn)

    Hi John,

    My question still stands. I still need to redirect /modular-wiring-catalogue/?s=something to /modular-wiring-catalogue/ with the pass-through method.

    This is absolutely essential for my search function to work, and given your plugin’s setting, I’m not sure why the regex I already have in place does not work.
    What I’m asking is what should I do in order for /modular-wiring-catalogue/?s=something to redirect through /modular-wiring-catalogue/? Is there an issue with my REGEX or is it something else?

    Plugin Author John Godley

    (@johnny5)

    It really makes no sense to do this pass through as the query parameters are already being passed to the page.

    I would imagine that the problem you are seeing is because of the pass through itself, not the regular expression.

    Plugin Author John Godley

    (@johnny5)

    Also, you haven’t said how it isn’t working. Exactly what part is not working?

    Thread Starter Nazrinn

    (@nazrinn)

    I don’t understand. I still get a 404 whenever I load the page with something like this: /modular-wiring-catalogue/?s=search.

    I feel like from what you are saying, it shouldn’t happen? Why would a pass-through redirection not work in that case?

    I tried another method of redirection but if it’s not pass-through it really defeats the purpose. I need ?s=search to stay in the URL when my modular wiring catalogue loads.

    Thread Starter Nazrinn

    (@nazrinn)

    Also, you haven’t said how it isn’t working. Exactly what part is not working?

    I don’t think we’re seeing eye-to-eye so let me actually record a video of the issue. I’ll get back to you.

    Plugin Author John Godley

    (@johnny5)

    A passthrough isn’t a redirect. It just loads the target page and returns that instead of the current page. Query parameters don’t come into this, and what you have doesn’t make sense. If you load the page directly the query parameters will be available to whatever code you are trying to run – a passthrough is not going to help in any way.

    Thread Starter Nazrinn

    (@nazrinn)

    Mmm. That’s odd then. Why would I be getting a 404 when I load /modular-wiring-catalogue/?s=search? Perhaps this conflicts with WordPress in some way. I’ll have to look into it, but I’m starting to think this might not be your plugin.

    Anyway, here is my video of the issue if it is to be of any use.

    I’ll go do some more test, but if you can get me any confirmation in regard to my issue, regardless of the cause, that would be much appreciated.

    Plugin Author John Godley

    (@johnny5)

    If you change the passthrough to a redirect, and the redirect works fine, then your expression is matching properly.

    It seems to me that you don’t need the passthrough at all and can just delete it. Then you will be dealing with the page directly, and if you need to render stuff in the client you can do that there with full access to the query parameters. The passthrough is a complicated way of making things more difficult.

    Thread Starter Nazrinn

    (@nazrinn)

    Seems like I found the issue. ?s= seems to be reserved by WordPress for blog searches. I changed my query parameter to ?search= and it the problem went away.

    The pass-through is working just fine, and it really is needed for my Javascript to render my page correctly (it uses the URL to render the correct view).

    Thanks for your help!

    • This reply was modified 8 months ago by Nazrinn.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Regex redirect not working with query parameters’ is closed to new replies.