We are overriding 404.php to show database generated content like this:
/products/x1/ /products/x2/ etc.
(if the url is /products/../ the 404 process is converted into a page).
Problem is that we have some media files that have permalink similar to the last part of our database generated content urls.
For example /x1/ which causes /products/x1/ to be redirected to /x1/ instead of showing the database generated content for /products/x1/.
Same thing with a post url like this /x2-specs/. It causes /products/x2/ to be redirected to the post instead of showing the database generated content for /products/x2/.
How do we disable the redirect of all urls that contain /products/?