Want to make SEO friendly url with the refineList

here is the routing setup
i made a search.$category.jsx file to componsate the route

 history({
      
      windowTitle({ category, query }) {
        const queryTitle = query ? `Results for "${query}"` : 'Search';

        if (category) {
          return `${category} – ${queryTitle}`;
        }

        return queryTitle;
      },

      createURL({ qsModule, routeState, location }) {
        const urlParts = location.href.match(/^(.*?)\/search/);
        const baseUrl = `${urlParts ? urlParts[1] : ''}/`;

        const categoryPath = routeState.category
          ? `${getCategorySlug(routeState.category)}/`
          : '';
        const queryParameters = {};

        if (routeState.query) {
          queryParameters.query = encodeURIComponent(routeState.query);
        }
        if (routeState.page !== 1) {
          queryParameters.page = routeState.page;
        }
        if (routeState.brands) {
          queryParameters.brands = routeState.brands.map(encodeURIComponent);
        }

        const queryString = qsModule.stringify(queryParameters, {
          addQueryPrefix: true,
          arrayFormat: 'repeat'
        });

        return `${baseUrl}search/${categoryPath}${queryString}`;
      },

      parseURL({ qsModule, location }) {
        const pathnameMatches = location.pathname.match(/search\/(.*?)\/?$/);
        const brand = getCategoryName(
          (pathnameMatches && pathnameMatches[1]) || ''
        );
        const { query = '', page} = qsModule.parse(
          location.search.slice(1)
        );
        // `qs` does not return an array when there's a single value.
        const allBrands = Array.isArray(brands)
          ? brands
          : [brands].filter(Boolean);

        return {
          query: decodeURIComponent(query),
          page,
          brand,
          category
        };
      },
      getLocation() {
        if (typeof window === 'undefined') {
          return new URL(serverUrl);
        }

        return window.location;
      },
    })