const pathMatch = targetPathArray.find((path) => pagePath.includes('/' + path + '/')); if (pathMatch) { missingPageRedirect(pathMatch); }