const pathname = usePathname();
<Link href={`${pathname}/locations`}>Hello</Link>
You should use the pathname to get the current path and append it to the new URL, as Link will navigate to the new URL directly without retaining the previous path.
Using Next Js 14 version