Bulk Redirecting categories to tags

I have a site which has tons of categories which I converted to tags. I am trying to figure out a way of auto redirecting any categories which have a 404 error to the corresponding /tag/ url instead of /category/

Any advice? Maybe a .htaccess script?