Redirect Entire Directory using Yoast

[ad_1]

I have a WP site using Listing Pro as a business directory.

All the categories have a structure of

www.NameofSite/listing-category/NameOfCategory

I want to change it so that they all redirect to

www.NameofSite/view/NameOfCategory

The purpose being to shorten the URL from the default for categories

There is a way in listingpro to make the change easily, BUT I was looking for a way to redirect all the old category names to the new category names without having to enter 40 different redirects.

Is there some kind of wildcard I can use?? The Yoast SEO interface has something called Regex but I can’t figure it out from the documentation.

To be clear, I don’t want all the old names to just redirect to one parent place, I want them to go to their individual names under the new structure

Thanks!!

[ad_2]
2 Comments
  1. Use a redirection plugin, like the one called Redirection 😉

    The rule is: `^/listing-category/(.*)/` => `/view/$1/`

  2. Be careful that you’re not messing with the plug-ins local disc mapping. I’d try the redirect on a staging or local site, first.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer