Support » Fixing WordPress » Regular Expression for redirecting category pagination

  • I’m trying to consolidate categories on my wp website and need help with 2 similar but different situations. I’m using the redirection plugin.
    (Also I’m already using Yoast’s Seo Plugin which already gets rid of the category sub folder. -> ….the plugin also adds the trailing slash..not sure if this is relevant, but want to provide as much info as possible)

    1. I’m changing the slug of a category that I will continue to use from:
    /cute-dogs/ -> /cute-and-fluffy-dogs/
    I did a plain old redirect, but that doesn’t redirect the pages?- ie. /cute-dogs/page/2/ -> /cute-and-fluffy-dogs/page/2/
    So is there a regular expression I can use in this case?

    2. I’m getting rid of /fluffy-dogs/ and redirecting to /cute-and-fluffy-dogs/ (the category above). Again, I did a plain old redirect but it doesn’t redirect the
    /fluffy-dogs/page/2/ -> /cute-and-fluffy-dogs/page/2/

    The same regular expression may work for both? But I’m not sure. Any help is greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not sure why you would need a regex. Wouldn’t a str_replace work?

    $new_url = str_replace(
       array('/cute-dogs/page/', '/fluffy-dogs/page/'),
       array('/cute-and-fluffy-dogs/page/', '/cute-and-fluffy-dogs/page/',

    I’m sorry I think we may be talking about 2 different things?

    I’ve already changed the urls, but I need to redirect the old urls that have inbound links and are indexed by search engines.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Regular Expression for redirecting category pagination’ is closed to new replies.