I was running a blog on my site but not in the root, I was running it in a directory called /blog/. The permalink for this blog was /%postname%/
There were six categories.
Now I have decided to move the blog to root of my site and change permalinks to /%category%/%postname%/ so that the site has a better structure and not all the posts are in the root of the site with /%postname%/ and needed to get rid of the “category” base.
All the /%postname%/ (slugs) are currectly redirected to their respective categories and I see URL as /%category%/%postname%/
However attached images/media pages from these old urls posts do not redirect, so all the traffic from search engines results into 404 pages.