How to Redirect an Entire Subpath to a Specific Page
If you are replacing an entire subpath on your website, you should use a different method.
For instance, if “A Site about Emojis” was selling colored emojis (red, green, blue, etc.), and one day I decided that I don’t want to sell blue emojis anymore, I would have to redirect that entire subpath.
In this example, I’ll show you how we can implement a single redirect for all of my product pages for blue emojis:
So, here’s how to do this:
- Go to “Tools” → “Redirection”;
- Click “Add new”;
- Enter your source URL (e.g. /blue-emojis).
- Keep in mind, you should only add the subpath URL here.
- So, for example, If the blue emojis I want to redirect would be sold at URLs /blue-emojis/product-1 and /blue-emojis/product-2, my source URL would be /blue-emojis.
- Add a forward slash and then the regular expression (.*) after that. So, my source URL would look like this: /blue-emojis/(.*).
- Enable “Regex”(regular expression).