I never thought I will grow to 3000 pages and when I started on of my blogs I had my permalinks set to %postname%
All of these 3000 pages are inside 5 different categories, but since I used %postname% the category slug do not show up in url of the page.
I wanted to move all these pages to their respective categories so that urls look like domain.com/category/postname/ instead of domain.com/postname
I understand that doing so will result in 404 errors for all these pages and I wanted to configure 301 redirects for them.
How can this be made possible.
Also, Can this result in search penalty?