Change product url structure in nopCommerce 4.7.5

i want to change product url structure in nopCommerce 4.7.05. and i change in nopCommerce 4.5 it working fine. but in 4.7.5 it also change url of category. after clicking on category it also add product in url that i don’t want.

I want like this on product detail page url
{host}/product/{productname}

and category page want like this url
{host}/{productname}

public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
{
var lang = GetLanguageRoutePattern();

 //default routes
 //these routes are not generic, they are just default to map requests that don't match other patterns, 
 //but we define them here since this route provider is with the lowest priority, to allow to add additional routes before them
 if (!string.IsNullOrEmpty(lang))
 {
     endpointRouteBuilder.MapControllerRoute(name: "DefaultWithLanguageCode",
         pattern: $"{lang}/{{controller=Home}}/{{action=Index}}/{{id?}}");
 }

 endpointRouteBuilder.MapControllerRoute(name: "Default",
     pattern: "{controller=Home}/{action=Index}/{id?}");

 if (!DataSettingsManager.IsDatabaseInstalled())
     return;

 //generic routes (actually routing is processed later in SlugRouteTransformer)
 var genericCatalogPattern = $"{lang}/product/{{{NopRoutingDefaults.RouteValue.CatalogSeName}}}/{{{NopRoutingDefaults.RouteValue.SeName}}}";
 endpointRouteBuilder.MapDynamicControllerRoute<SlugRouteTransformer>(genericCatalogPattern);

 var genericPattern = $"{lang}/product/{{{NopRoutingDefaults.RouteValue.SeName}}}";
 endpointRouteBuilder.MapDynamicControllerRoute<SlugRouteTransformer>(genericPattern);

 //routes for not found slugs
 if (!string.IsNullOrEmpty(lang))
 {
     endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericUrlWithLanguageCode,
         pattern: genericPattern,
         defaults: new { controller = "Common", action = "GenericUrl" });

     endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericCatalogUrlWithLanguageCode,
         pattern: genericCatalogPattern,
         defaults: new { controller = "Common", action = "GenericUrl" });
 }

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericUrl,
     pattern: $"{{{NopRoutingDefaults.RouteValue.SeName}}}",
     defaults: new { controller = "Common", action = "GenericUrl" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericCatalogUrl,
     pattern: $"{{{NopRoutingDefaults.RouteValue.CatalogSeName}}}/{{{NopRoutingDefaults.RouteValue.SeName}}}",
     defaults: new { controller = "Common", action = "GenericUrl" });

 //routes for entities that support catalog path and slug (e.g. '/category-seo-name/product-seo-name')
 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.ProductCatalog,
     pattern: genericCatalogPattern,
     defaults: new { controller = "Product", action = "ProductDetails" });

 //routes for entities that support single slug (e.g. '/product-seo-name')
 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Product,
     pattern: genericPattern,
     defaults: new { controller = "Product", action = "ProductDetails" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Category,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Category" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Manufacturer,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Manufacturer" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Vendor,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Vendor" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.NewsItem,
     pattern: genericPattern,
     defaults: new { controller = "News", action = "NewsItem" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.BlogPost,
     pattern: genericPattern,
     defaults: new { controller = "Blog", action = "BlogPost" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Topic,
     pattern: genericPattern,
     defaults: new { controller = "Topic", action = "TopicDetails" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.ProductTag,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "ProductsByTag" });

}

i try to change in this method but it reflect on both product detail and catagory both url.
i only want chnages in productdetail page. please give me solution as soon as possible.
please remember i want solution in nopcomecre 4.7.5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Change product url structure in nopCommerce 4.7.5

i want to change product url structure in nopCommerce 4.7.05. and i change in nopCommerce 4.5 it working fine. but in 4.7.5 it also change url of category. after clicking on category it also add product in url that i don’t want.

I want like this on product detail page url
{host}/product/{productname}

and category page want like this url
{host}/{productname}

public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
{
var lang = GetLanguageRoutePattern();

 //default routes
 //these routes are not generic, they are just default to map requests that don't match other patterns, 
 //but we define them here since this route provider is with the lowest priority, to allow to add additional routes before them
 if (!string.IsNullOrEmpty(lang))
 {
     endpointRouteBuilder.MapControllerRoute(name: "DefaultWithLanguageCode",
         pattern: $"{lang}/{{controller=Home}}/{{action=Index}}/{{id?}}");
 }

 endpointRouteBuilder.MapControllerRoute(name: "Default",
     pattern: "{controller=Home}/{action=Index}/{id?}");

 if (!DataSettingsManager.IsDatabaseInstalled())
     return;

 //generic routes (actually routing is processed later in SlugRouteTransformer)
 var genericCatalogPattern = $"{lang}/product/{{{NopRoutingDefaults.RouteValue.CatalogSeName}}}/{{{NopRoutingDefaults.RouteValue.SeName}}}";
 endpointRouteBuilder.MapDynamicControllerRoute<SlugRouteTransformer>(genericCatalogPattern);

 var genericPattern = $"{lang}/product/{{{NopRoutingDefaults.RouteValue.SeName}}}";
 endpointRouteBuilder.MapDynamicControllerRoute<SlugRouteTransformer>(genericPattern);

 //routes for not found slugs
 if (!string.IsNullOrEmpty(lang))
 {
     endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericUrlWithLanguageCode,
         pattern: genericPattern,
         defaults: new { controller = "Common", action = "GenericUrl" });

     endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericCatalogUrlWithLanguageCode,
         pattern: genericCatalogPattern,
         defaults: new { controller = "Common", action = "GenericUrl" });
 }

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericUrl,
     pattern: $"{{{NopRoutingDefaults.RouteValue.SeName}}}",
     defaults: new { controller = "Common", action = "GenericUrl" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.GenericCatalogUrl,
     pattern: $"{{{NopRoutingDefaults.RouteValue.CatalogSeName}}}/{{{NopRoutingDefaults.RouteValue.SeName}}}",
     defaults: new { controller = "Common", action = "GenericUrl" });

 //routes for entities that support catalog path and slug (e.g. '/category-seo-name/product-seo-name')
 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.ProductCatalog,
     pattern: genericCatalogPattern,
     defaults: new { controller = "Product", action = "ProductDetails" });

 //routes for entities that support single slug (e.g. '/product-seo-name')
 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Product,
     pattern: genericPattern,
     defaults: new { controller = "Product", action = "ProductDetails" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Category,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Category" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Manufacturer,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Manufacturer" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Vendor,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "Vendor" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.NewsItem,
     pattern: genericPattern,
     defaults: new { controller = "News", action = "NewsItem" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.BlogPost,
     pattern: genericPattern,
     defaults: new { controller = "Blog", action = "BlogPost" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.Topic,
     pattern: genericPattern,
     defaults: new { controller = "Topic", action = "TopicDetails" });

 endpointRouteBuilder.MapControllerRoute(name: NopRoutingDefaults.RouteName.Generic.ProductTag,
     pattern: genericPattern,
     defaults: new { controller = "Catalog", action = "ProductsByTag" });

}

i try to change in this method but it reflect on both product detail and catagory both url.
i only want chnages in productdetail page. please give me solution as soon as possible.
please remember i want solution in nopcomecre 4.7.5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật