Thanks to @C3roe for mentioning similar question at here.
I achieved that with following configuration:
RewriteCond %{REQUEST_URI} ^.*/([^/]+)$ RewriteCond %{REQUEST_URI},${product_map:%1|NOT_FOUND} !^([^,]+),(\1|NOT_FOUND)$ RewriteRule ^ - [G,L]