'dynamic slug with a static slug - SSR

I have these routing:

/blog/slug
/blog/search/search-keyword

slug is dynamic and search is static and search-keyword is dynamic.

but with below structure I got 404 error:

/blog
  /search
     index.tsx
  /[slug].tsx
  /index.tsx


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source