• Resolved jodamo5

    (@jodamo5)


    I have setup this simple regex redirect with wildcard:

    ^/for-people-with-disabilities/*

    View post on imgur.com

    The target does NOT have $1 because I want all previous articles that were in that category to now direct to a single page:

    Target: /learning-information/online-information-hub/

    Example URL:
    /for-people-with-disabilities/help-transport-costs/

    Expected outcome: It should redirect to
    /learning-information/online-information-hub/

    Actual outcome: It is redirecting to:
    /learning-information/online-information-hub/help-transport-costs/
    Which then gives the user a 404 error.

    So it is acting like I have inserted $1 onto the end of the target, even though I haven’t.

    Any idea what might be causing this?

    Host information: I’m using Cloudways hosting. (Thought I’d mention it just in case it is relevant).

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

    (@johnny5)

    A regex is not a wildcard. Your example uses wildcards, and you will need to use a regular expression.

    https://redirection.me/support/redirect-regular-expressions/

    Thread Starter jodamo5

    (@jodamo5)

    Thanks for the quick reply John. I had already read through your documentation and thought I had followed the instructions. Specifically, I used * and not (.*) and didn’t use $1.

    However, upon re-reading it, I can see the difference is that I need it to say .* instead of just *. I think this is what you mean when you say my example is using a wildcard instead of regex – I needed to add the “.”

    So to help anyone else who gets tripped up on the same thing, here’s the summary:

    Wrong: ^/for-people-with-disabilities/*
    Right: ^/for-people-with-disabilities/.*

    • This reply was modified 1 year, 11 months ago by jodamo5.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Regex Wildcard Source Is Being Passed to Redirect Even Without $1in Target’ is closed to new replies.