I have inherited a site that was built with Joomla and the migrated to WordPress. There are 500 posts with the same name, but the path before the name of the post is different. How can I write in htaccess a rule that chceck if the name of the post is identical then it redirects to the new path+name of post without having to write 500 "301 redirects"?
All old pages have been indexed and they give 404 errors. They posts have been imported from Joomla to Wordpress with a plugin and they all exists in the new website.
Old website:
http://vitalpethealth.co.uk/index.php/dogs/dog-section-layout/dog-behaviour-and-training/447-separation-anxiety-of-our-dogs
New website:
http://vitalpethealth.co.uk/separation-anxiety-of-our-dogs/
Any pointer is much appreciated.