• Resolved fohteh

    (@fohteh)


    I’ve come accross some pagination page 404’s in the logs

    So;

    We used have .com/category/xxx/yyy/ category with pagination. We removed that page and added redirect it .com/category/oooo/

    source: /category/xxx/yyy/
    target: /category/oooo/

    When we checked the logs and .com/category/xxx/yyy/page/14/ giving 404.
    Will this issue be resolved if;

    by checking the regex and adding .* expression in the end of source url.

    source: /category/xxx/yyy/.*
    target: /category/ooo/

    Thank you!

    • This topic was modified 7 years, 1 month ago by fohteh.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Assuming your actual configuration is generating paginated results as

    /category/ooo/page/2/ etc

    You could try this:

    source: /category/xxx/yyy/(.*)
    target: /category/ooo/$1

    More on Regex: https://redirection.me/support/redirect-regular-expressions/

    Thread Starter fohteh

    (@fohteh)

    Hello Brandt

    Thank you for your reply. Sorry I’m not an expert on the issue. Can you give me more explanation?

    As you said. 404 log is /category/xxx/yyy/page/2/ etc and so on.

    When we redirect as below, means that every single 404 pages with number redirected to the target url’s page number?

    source: /category/xxx/yyy/(.*)
    target: /category/ooo/$1

    Hi @fohteh,

    I’m not an expert either, just trying to help with the little I know 🙂

    With the regex I suggested above, the (.*) is a capture group, that will capture anything after /category/xxx/yyy/ until the end of the line and pass it along to the $1 element on the target. So it should redirect as follows:

    source: /category/xxx/yyy/(.*)
    target: /category/ooo/$1

    /category/xxx/yyy/page/2/ will be redirected to
    /category/ooo/page/2/

    /category/xxx/yyy/page/3/ will be redirected to
    /category/ooo/page/3/

    and so on. I’m just following the examples you gave initially, but you’d should check if the redirects work as expected and report back, if you wish, with more details if there’s any problem.

    Thread Starter fohteh

    (@fohteh)

    Hi CB

    Unfortunately it does not work, it still falls to 404’s

    The removed link is below;
    /category/egirme/elyaf/page/1/

    Redirect link is

    /category/egirme/page/1/

    Do you have any idea what is the issue?

    H, @fohteh,

    I don’t believe WordPress generates a /page/1/ URL, the pagination starts with page 2.

    /category/abc/ <<< this is page 1
    /category/abc/page/2/
    /category/abc/page/3/
    etc.

    So for the specific category provided, I’d try:

    source: /category/egirme/elyaf/page/(*.)
    target: /category/egirme/page/$1

    Thread Starter fohteh

    (@fohteh)

    Hi CB

    Unfortunately it doesn’t work..

    Thank you for your help friend.

    I hope the the plugin author have any solution to it.

    Thanks a lot!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Life Saver Plugin so far. Simple Regex Question’ is closed to new replies.