Developer forum

Forum » CMS - Standard features » URL race for the best URL

URL race for the best URL

Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hello,

I have a site that seems to regularly race for the best URL and sometimes gets the friendly URL and sometimes gets the one with the "-1" on the end. 

The odd thing is that it only seems to only happen to the Blue variant, and not to other colors. I don't see any duplicate products with the same name, or duplicate variant options (for the same variant group) of the same color. 

We can reproduce on a test site (it's happening in production too, with the same products)

https://qa-walleye.dw-demo2.com/p/dock-accessories/roll-a-dock-accessories/30-half-round-bumper-horizontal/blue-1

Right now it has the -1 on it, but it may not always. This solution does have 2 sites on it, and the 2nd site shares the same product catalog, so that may cause some issues, but we've worked out all of the other issues and this appears to be the last remaining URL pattern like this.

Any ideas what this would be, or where to look further?

Thanks,

Scott

 

 


Replies

 
Nicolai Pedersen
Reply

Hi Scott

You are using the 'old' url providers. There are new ones in place that will better ensure that this is not happening - they handle the entire path as one unique string (i.e. website+page+group+product+variant)

The old ones you are using here, has an index for each part of the url. So all variant ids share "/blue" key - no matter their context of variant group, product etc. So you have two variant options named blue, hence the -1. A bumper color named "blue" and an apparel color named "blue".

BR Nicolai

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

I see what you mean. That has potential. I tried it out and some parts look better. However, it appears that "Ignore parent groups in URL" isn't implemented in that provider yet, so our URL gets even longer as a result. I see that you had a discussion about that here: https://doc.dynamicweb.com/forum/ecommerce-standard-features/ecommerce-standard-features/how-to-use-ecommerce-page-url-provider

We'll do some more testing though and see if we can get a combination that works well for this site. 

Scott

 

 
Nicolai Pedersen
Reply

You can make the URLs much shorter. See my attachment.

Screenshot_2020-12-07_171156.JPG
 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

Yes, but that's too short. This project has the same-named products in multiple categories, so we would like to selectively remove some folder names from the path without going all in or all out.

Speaking further with the customer, he asked a good question which is if it's possible to find out what's special about Blue. Maybe the old provider will do the trick since it works in all other ways for us now. Any suggestions on how to troubleshoot that? Possibly the old provider is still the best option for this project, if we can figure out this one situation. 

Thanks,

Scott

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

As I reread the thread, I realized that you already mentioned the duplicate Blue across different variant groups. Even though no products have both variant groups at the same time, it sounds like this is the likely cause. So we'll take another pass at exploring our options. I believe that we have a line of sight on the options again.

Scott

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

We've been playing with the new URL provider for this situation and we're considering making the change, but I have two questions:

  • When a product belongs to multiple ecom groups, it has a new URL for each group that it's in (e.g. https://qa-walleye.dw-demo2.com/10-nylon-dock-cleat, https://qa-walleye.dw-demo2.com/10-nylon-dock-cleat-1, https://qa-walleye.dw-demo2.com/10-nylon-dock-cleat-2, etc). Can that be changed with the current version of the platform (9.9.3+)? For SEO reasons, we only need one URL when it's the exact same product.
  • (low importance) Is it possible to have a base URL like /p/ or /products/? It appears that no part of the content page url is used. We've decided that we can live with everything in the root, but we would prefer to have products in a subfolder.

Thanks,

Scott

 

 
Nicolai Pedersen
Reply

Hi Scott

How should @1 work? If you navigate the product from group1 and navigate the same product from group2 and the result is the same product URL. What about the breadcrumb then? Or what about group information on the product detail. What should those fallback to? How would you create a link that navigates back?

Remember that the URL is a rewrite of /productname to something like Default.aspx?ID=123&Groupid=234&productid=345. So if they where to share only one URL (Unique Resource Locatoer) that would result in you can never see the product in the context of other groups than the primary. Are you sure that is what you want? 

Currently you cannot have /pagename/product - you can have /pagename/groupname/productname/pagename/[parentgroup/]groupname/productname or you can have /groupname/productname[parentgroup/]/groupname/productname.

@2: I cannot see why you would want /pagename/product - it is not a unique option and confuses users. The best option by far, SEO and UX wise, would be /groupname/productname - it tells users and search engine all they need to know about the product, makes the product rendering group context aware, and canonicals will handle that the same products have 2 urls (what is mistaken for duplicate content, which it is not).

BR Nicolai

 

You must be logged in to post in the forum