From doing some research, I'd recommend trying out this plugin: Redirection. This plugin allows you to manage 301 redirections.
I played around with the settings and they allows regular expressions which could do the following:
They provide documentation on how to set it up which can be found here. This is what I've done when creating the rule, try this:
- Source URL:
- Target URL:
I was testing this out on a local copy of WordPress and I don't have anything right now that gives me those URL structures. Let me know if that works for you on your end. Again, you can play around with the regular expressions to get it right.