Issue with migrating seo urls

Hi Guys,

I was trying to migrate a Shopware 5 application to Shopware 6. I got almost everything fine. However, the redirect URL didn’t work as expected.

The previous product redirect URL have a format something similar to

domain/YYYY?number=XXXX

where YYYY is a custom seo-url
and XXXX is the product order number.

Now in sw6, I could regenerate the similar URL using SEO template, but however, the URL does not work as expected. I am always getting error with message „No route found for domain/YYYY.“

So what am I missing here? Am I doing it wrong? Please share your ideas.
Thank you