EcomDev_UrlRewrite icon indicating copy to clipboard operation
EcomDev_UrlRewrite copied to clipboard

"-1" at the end of product url

Open mkutyba opened this issue 10 years ago • 5 comments

I don't know if this project is alive but maybe someone will help me. When using this module urls have "-1" at the end, and it redirects from "normal" to "-1", e.g. "product-a.html" to "product-a-1.html"

It works for basic product urls, but in category it doesn't: "cat1/product-a.html" is 404 "cat1/product-a-1.html" is 200

Also rel=canonical is now "cat1/product-a-1.html".

How to get rid of this "-1" part? Of course it should be left for duplicates (if occur), so they will have "-2", "-3", ... I think it is the reason, but why 1st is treated as duplicate?

mkutyba avatar May 15 '15 07:05 mkutyba

@mkutyba - did you ever solve this issue?

ProxiBlue avatar May 02 '16 22:05 ProxiBlue

possible solution: https://github.com/EcomDev/EcomDev_UrlRewrite/pull/22

ProxiBlue avatar May 03 '16 09:05 ProxiBlue

#22 should be fine, I made something similar to this

mkutyba avatar May 04 '16 08:05 mkutyba

Just to reiterate the bug for people that are unaware.

If your url key ends with an integer, then the indexer code will append "-1" to the end of the product url.

@mkutyba Can you share your regex please?

yattias avatar May 04 '16 15:05 yattias

Mine is here https://github.com/mkutyba/EcomDev_UrlRewrite/commit/8d181d270d66562b75563ad38df237b74eae15c2 But changes proposed by @ProxiBlue seem to be better. They need some unit tests.

mkutyba avatar May 04 '16 15:05 mkutyba