I am trying to route these urls to [id].js file in next.js, So everything is working for url 2 and 3 below, but its not working for url 1 so I have to create another index.js file which I dont want. Is is possible to use the same [id].js file? for url 1 also.
url 1 -> /settings
url 2 -> /settings/notifications
url 3 -> /settings/security
my file structure
settings > [id].js
getting the id
const router = useRouter()
const { id } = router.query;