简体   繁体   中英

Magento URL rewrite append random number in Url

I am using magento 1.8.1 previously I had product with duplicate names so there was problem of appending random number at end of url. But now we do not have any duplicate product name in our site we have done some changes in it just as White Plastic Serving Spoon - 144 per case and Fineline White Plastic Serving Spoon - 144 per case still they are having same urls and appending random number to the url of first product.

I have truncate Core_url_rewrite table and reindex Catalog URL Rewrites still having random number at end of urls.

I have also reffer link https://magento.stackexchange.com/questions/1565/why-magento-product-url-duplicating

and change code in app/code/core/Mage/Catalog/Model/Url.php at line 809

from

if ($product->getUrlKey() == '' && !empty($requestPath)
        && strpos($existingRequestPath, $requestPath) === 0
    )

to

if (!empty($requestPath)
        && strpos($existingRequestPath, $requestPath) === 0
    ) 

Truncate core_url_rewrite table and reindex Catalog URL Rewrites but I have same problem again. please provide guidance how can I solve this issue and what I am missing in above steps.

  • Login to admin panel.
  • Click on product to edit it.
  • Under General tab, delete "URL Key" and save the product.
  • Reindex Now and now access product in frontend.

Magento will now create new url for product.

I hope it will solve your problem.

I have solve this problem. Actually Urls has a store view scope. for that I had same url White-Plastic-Serving-Spoon-144 per case for two products such as White Plastic Serving Spoon - 144 per case and Fineline White Plastic Serving Spoon - 144 per case . so I change url key of products which having duplicate urls By store view. After that I truncate the Core_url_rewrite table and reindex Catalog URL Rewrites so it removes random number from the url's end. Now I have all proper Urls

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM