CB
(@cbrandt)
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
CB
(@cbrandt)
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?
CB
(@cbrandt)
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!