Option 1: Using numerical IDs for products


Option 2: Using hyphen-separated numerical IDs for products


So, I will capture the numerical value from both above patterns and send it to the query.

Option 3: Using product names directly


From the above pattern, I have to keep the slug part for every product and then get the relevant record.

I have to use the right URL STRUCTURE FROM THE beginning. Your thoughts regarding this highly appreciated.

1 Answer 1


None of your proposed URLs will have a significant SEO advantage over the others. Google doesn't care that much the minutia of your URL structure. There are however several other issues to think about.

Host name

You won't be able to use localhost as your host name and have it indexed by search engines. You'll want to switch this to a domain name so that search engine bots can crawl it.

Port number

You don't want :7043 in your URL either. You'll want to use a web server on the default 443 port so that you can omit that ugliness from your URLs.


Regardless of which URL structure you choose, I recommend making your entire URL lowercase. samsung-970-evo-plus-1tb-vs-kingston is much easier to canonicalize than Samsung-970-EVO-Plus-1TB-vs-kingston. Even in your example, why isn't "Kingston" capitalized? Search engines treat different case URL paths as different URLs. You need to be able to redirect to your preferred capitalization or use canonical meta tags to point to your preferred version.

Truncated URLs

You need to think about what happens when your URLs get shortened. Can you recover and redirect properly? If a search engine crawler requests /products/1/2/samsung-9 can you redirect it to /products/1/2/samsung-970-evo-plus-1tb-vs-kingston?

Using numeric IDs near the beginning of your URL paths can help with this, especially if your URLs could get long enough that emails and other sites start wrapping or truncating them.

Directory browsing

What will you serve if a crawler tries to view the contents of the directories. Every time you use a / in a URL, you should be prepared to support content with everything after the slash removed. Are you planning to build content at the following URLs?

  • /products/1/2/
  • /products/1/
  • /products/1-2/
  • /products/

If not, you should choose a character other than a slash as a separator in those locations in your URL.

Comparison order

Is there a difference between these two comparisons?

  • /samsung-970-evo-plus-1tb-vs-kingston
  • /kingston-vs-samsung-970-evo-plus-1tb

To avoid completely duplicate URLs based on product order, you need to be able to choose which one comes first in your canonical URLs. You might want to alphabetize them and redirect when they are in the non-canonical order.

Thin content

If you have a group of products that you are planning to offer comparisons for, how are you filling in all the pages with sufficiently robust content? Lets say the products in a group are foo, bar, baz, and gah. Are you planning to have all the comparison URLs?

  • /bar-vs-foo
  • /bar-vs-baz
  • /bar-vs-gah
  • /baz-vs-foo
  • /baz-vs-gah
  • /foo-vs-gah

How are you planning to write content for so many cases? Keep in mind that Google doesn't like auto-generated text. Also keep in mind that number of pages will get exponentially larger with larger product groups.

  • @Stephan Thank you so much for this detailed explanation. I must say you are a mentor for me. Your answers helped me a lot. At this point you answered all of my questions and mostly you guide me how to think. I will reply to this thread if I need a clarification regarding your content. But so far no. I thought to go with /products/1-2/samsung-970-evo-plus-1tb-vs-kingston. pattern. so dash will give comparison. otherwise like you said it will be treated like a category. Commented May 16, 2023 at 14:03
  • @oster Now I have a URL structure where test.com/specs/12-15/stest1-256gb-vstest2-256gb . where if the URL structure changed 15-12 I am adding canonical to 12-15 as you suggested. My coding pattern allows me to add unlimited comparisons. So I thought to add 3 products for comparison. In this case how I handle duplicate penalty and how I use proper canioncal tags. Now URL sturcre will change to test.com/specs/12-15-20 something like this. APPERICAITE YOUR FEEDBACK Commented Jun 14, 2023 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.