"true" seo urls capabilities

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Curious if anyone has put effort into a fully configurable "friendly" url system for nop? the seo friendly urls in place now are nice, but I'd still love to see a fully editable one. For instance, for my website selling paintball barrels, I'd like to be able to add a category for "paintball barrels" which has a url of deadlywind.com/paintball-barrels ... A good way to implement this is how orchard does it - it looks at your title, and suggests a url for it. But you can then edit it to a different url if you care to, then save it.

This is just yet another option that helps a tiny bit with optimization... but a useful one for a variety of reasons as well.
12 years ago
Already on the roadmap. Please vote here
12 years ago
What about this:

1) Register routes for each product, category, manufacture with it SeoName

public void RegisterRoutes(RouteCollection routes)
        {
            var productService = EngineContext.Current.Resolve<IProductService>();
            var products = productService.GetAllProducts();

            foreach (var product in products)
            {
                routes.MapLocalizedRoute(string.Empty,
                                         product.SeName,
                                         new
                                             {
                                                 controller = "Catalog",
                                                 action = "Product",
                                                 productId = product.Id
                                             },
                                         new[] {"Nop.Web.Controllers"});
            }


            var categoryService = EngineContext.Current.Resolve<ICategoryService>();
            var cats = categoryService.GetAllCategories();

            foreach (var cat in cats)
            {
                routes.MapLocalizedRoute(string.Empty,
                                         cat.SeName,
                                         new
                                             {
                                                 controller = "Catalog",
                                                 action = "Category",
                                                 categoryId = cat.Id
                                             },
                                         new[] {"Nop.Web.Controllers"});
            }
        }

2) Change default routes on:

routes.MapLocalizedRoute("Product",
                           "{SeName}",
                           new { controller = "Catalog", action = "Product", SeName = UrlParameter.Optional },
                           new { productId = @"\d+" },
                           new[] { "Nop.Web.Controllers" });
            
routes.MapLocalizedRoute("Category",
                           "{SeName}",
                           new { controller = "Catalog", action = "Category", SeName = UrlParameter.Optional },
                           new { categoryId = @"\d+" },
                           new[] { "Nop.Web.Controllers" });
12 years ago
olegin wrote:
What about this...

Not the best solution. It can really slow down the system if you have thousands of products. It also doesn't make any required validation in order to ensure that there's no any products with the same name
12 years ago
a.m. wrote:
What about this...
Not the best solution. It can really slow down the system if you have thousands of products.

I agree, but in current version I found only this solution.

a.m. wrote:

It also doesn't make any required validation in order to ensure that there's no any products with the same name

Validation on unique SeoName must be implemented in admin area.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.