So I recently moved my website from an old CMS to WordPress.
Re-imported 3000+ to WP and now all the old urls are 404.

I would like to 301 redirect all my posts within the htaccess.
The domain is still the same. I just need to remove the part ( category/category ) in the middle of all my urls.

This is the old url structure: (404s errors)
www.mywebsite.com/category-A/category-one/post-name
www.mywebsite.com/category-A/category-two/another-post-name
www.mywebsite.com/category-A/category-three/another-beautiful-post-name
etc.

This is the new structure I have (I need to redirect to this):
www.mywebsite.com/post-name
www.mywebsite.com/another-post-name
www.mywebsite.com/another-beautiful-post-name
etc.

Is there a way or do I need to thought each one by one?

Thank you

Read more here: Redirect to a new url structure – same domain


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: