I have been having problems with my URL's once six months ago and again now, but before it was issues in daylilies for sale. Now this time its for products under daylilies for sale. I am getting numbers as suffix in my products URLs like

http://www.decadentdaylilies.com/daylilies-for-sale/shades-of-havana-18.html when the URL should read http://www.decadentdaylilies.com/daylilies-for-sale/shades-of-havana.html

not Same product with different number for different category:

May I know the reason for that? How it is being done? And What part of Magento does that?


It is mentioned Here But I also copy it here

Typically this is caused because you have categories or products with duplicate urls. i.e a category with www.example.com/hats and a product with same url. Every time you save the product you will incrementally increase the core rewrite. The number you see at the end of your URL. The other main culprit is configurable products.

Step 1

Make sure the URL you’re trying to achieve is in fact unique.

There is a reason Magento appends these numbers to the end of your URLs, because it actually already exists. It’s like creating two categories with the same name in WordPress, the second category will have the URL “/category-2/”.

Step 2 Do a database backup

Open up PHPMyAdmin or something similar.

Find the Core_url_rewrite table.

Search for your url in the request path. In my example I typed: ‘hats%’ this will find anything beginning with hats in the url.

Step 3

Just remember if you hard linked this page it will now 404. So if there is a risk of this, make sure you create a new redirect after this for that page.

Delete all rows from the search results.

Step 4

Reindex your Catalog URL rewrites.

Step 5

Go back to the category or product and click save.

Your urls should now be as desired!

The upgrade will help with the underlying cause of this, but will not correct it. You will still need to run through this process regardless.

  • Hi, Is there anything that will stop this from happening, I don't understand why this is happening in the past 8 months and haven't had a problem with this before, and have had the same website with different categories for at least 3 years. Mar 19 '15 at 9:34

To cease this issue, the cause need to be taken care of. The cause of getting numbers appended to the URL is almost always duplicated product names (product URL key when you created the products). If you have unique product names, this unique product URL keys, you will not get this issue.

If you don't care about any of those URLs with numbers appended at the end, do the following. Do it on a test environment first, of course.

  1. Check all of your product names. Make sure they're unique.

  2. truncate the core_url_rewrite table.

  3. Re-index once and check URLs.

  4. Re-index again and check again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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