wordpress – RankMath redirect error caused by use of regex

I changed the WP permalink structure for my site and have been using RankMath’s redirect feature but I’ve just realised an issue.

Previously the URL structure was:

website.com/category/(sometimes subcategory)/post-title

After the permalink change, the URL structure is now:

website.com/post-title

On RankMath, using the regex function, the source URL is set to /category/(.*) while the destination URL is website/$1. This correctly redirects the old URLs to the new URLs.

However, I’ve just realised that when you go into the archive page for a particular category to browse other stories in that category, you can only ever see the first page. Subsequent pages, because the URL becomes website.com/category/2/, automatically redirects to the general archive.

Is there a way to fix this?

Read more here: Source link