3

I am wanting to add redirects from old site URL to new site URLs however when I go into URL Rewrite Management there are over 8,000 records there already. Can I delete these?

Most of them are in the following format: ID Path: product/1483 Request Path: brilliant-whisper-300-1483.html Target Path: catalog/product/view/id/1483

I'm hesitant about deleting them if they are necessary...

Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
emma
  • 31
  • 1
  • 1
  • 2

3 Answers3

4

The answer is - as always - it depends :)

In general, you can truncate (not delete!) the table core_url_rewrite. If it is empty, your SEO URLs like brilliant-whisper-300-1483.html will not work for the time being. But if you do a full reindex of the catalog URL rewrites, these URLs will be generated again, so that your SEO URLs should work again.
If you struggle with a very big core_url_rewrite table, then have a look at this Magento StackExchange question.

What can cause problems is if you did one of the following:

  1. You changed the URL key of a catalog/product and ticked the box Create Permanent Redirect for old URL. Assumed you changed the URL key from my-old-product-name to my-new-product-name. Then, when this box is ticked, a rewrite from my-old-product-name.html to my-new-product-name.html will be created in the core_url_rewrite table. If you truncate the table, this rewrite will be gone, so that your old product URL will not work any more.
  2. You created custom URL rewrites under Catalog - URL Rewrite Management. These custom URL rewrites will also be gone if you truncate core_url_rewrite.
Simon
  • 5,735
  • 1
  • 32
  • 70
  • Thank you for giving a more objective answer. If you're worried about 301 redirects for pages whose URL keys have been changed after Google has indexed the pages and they've been linked to elsewhere, you get a little less cavalier about just blindly truncating this table. Only in 1.7 and 1.8 where there's a category save bug, do you get concerned about "excessive" numbers of entries. SUPEE-389_EE_1.12.0.2_v1.patch – Fiasco Labs Sep 05 '14 at 02:47
1

for me with 1.9.2 this does a temporary fix. Simons link is more permanent..check it out. So instead of truncating all of the data, especially if your custom urls are THE most important function of the core rewrites, you can query the database to omit custom url rewites and to show only the system url rewites. Then you can delete your system url rewrites. However, this will cause problems IF you still NEED your old urls, you will lose your old URL's this way. Some people do not need the old url's. Its a quick dirty way to clean that rewrite table. as always export backups FIRST.

Marius
  • 197,939
  • 53
  • 422
  • 830
user26152
  • 56
  • 5
0

Truncate core_rewrite table after doing a backup of that table. That should do the job.

mbalparda
  • 7,363
  • 3
  • 23
  • 46