简体   繁体   中英

Magento URL rewrite reverts default system URL after re-indexing

I have a weird problem with Magento. I have created catalogs and rewrite it to display custom page and product. The rewrites are successful however after re-indexing the default system URL were shown.

These are my steps in URL re-writing:

  1. Delete old system URL.

  2. Create new URL re-write by selecting custom in the drop-down box.

  3. Fill out necessary fields and save.

  4. Flush Magento cache.

The problem is that when I try to re-index, the system URL reverts back.

QUESTION:

  1. Why is it that the old system URL reverts back?

  2. What are the necessary procedures to prevent this to happen?

  3. Do I have to stop re-indexing for the entire life of the system?

This is a sample screen shot of my URL rewrite after re-indexing.

在此处输入图片说明

Thanks!

This is how I solved my problem

Based on this question Magento 1.7.0.2 Index Management overwriting URL Rewrites I discover a good solution.

I back up my database. I delete all my custom url rewrite that are not deleted after reindexing. I locate the default system catalog URL rewrite and update Redirect drop down from No to Permanent (301) and save it. I create new custom URL rewrite. I create a unique ID Path (catalog/153) From the default system catalog URL rewrite I copied the Target Path and paste it on Request Path of my custom URL rewrite. On the Target Path, I pasted the desired Page URL. Change the Redirect drop-down from No to Permanent (301) and save it. Finally, I clear my cache and re-index again. Problem solved!

Every time I re-index, all URL rewrite were not deleted and works perfectly fine.

To resolve above issue, follow the below-mentioned steps:

Step 1- Goto Catalog-> URL Rewrite Management and search for id in the ID path column.

Step 2- Open it and change the redirect option from No to Permanent(301). Also, copy the text inside Target Path non-editable field. It may look like this catalog/category/view/id/55.

Then click on Save.

Step 3- Then for redirecting this category page to Custom or CMS page, we've to add new URL rewrite.

To do so, Click Add URL rewrite button in Catalog->URL rewrite Management. It'll take you to Add New URL rewrite screen, where you've to choose Custom from Create URL Rewrite drop-down list.

It will then take you to another new page where you've to enter ID path, Request Path, and Target Path.

ID path — It must be any unique identifier. It can anything like "test123" or whatever as you wish.

Request Path — It must be the Target path which we've copied before catalog/category/view/id/55 in step1.

Target Path — It should be the Custom or CMS page URL Key which you want to redirect. For example Gift.

Then select Redirection to Permanent(301) from the drop-down and click on Save.

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