Redirect 5 Categories & Products To Just 1 Url

I have 5 categories eg

mysite.com/masks/product-cat-1/product-code-1.html

mysite.com/masks/product-cat-2/product-code-2.html

I would like to redirect a whole bunch of products that are in each category by a redirect with a wildcard so any product within that category gets redirected 302. Is it possible or woud I have to redirect hundreds of individual products one by one

I have popups informing them on each page but people just arent seeing or reading the popup so I want them to be completely redirected from the whole categories/products until back in stock

You can redirect a category OR product. But you can't redirect both to a common url since they are objects of different types. Note that the seo_redirects schema requires an object_id and a type.

Note that I'm making assumptions based on the db schema and have not directly tested whether you can have a 'src' of one type redirecting to a 'dest' of another type.... But my guess is no.

I'd suggest you rethink your categories and then let the system handle the redirects for you leaving the seo names of the products alone.

It is not possible with built-in tools

Use redirects in .htaccess or nginx configuration