I need the router redirects to the page "/" when the URL doesn't have any queryString parameters ("/domain/search"). But if it has any, for example "/domain/search?keyword=something&page=1", it should go on and render the component Movies.
My code below doesn't work, it still redirects to "/" even if the URL has some queryString parameters.
Please help with this problem.
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Search />} />
<Route path="search" element={<Navigate to="/" />} />
<Route path="search/*" element={<Movies />} />
</Route>
</Routes>