Magento 1.9 – Fix Custom URL Rewrites Deleting After Reindex

magento-1.9url-rewrite

I've researched this problem but still I have got no idea on how to fix it.

So, I worked on creating a proper menu structure for my products and by doing so, I have made categories with the intention of linking them up to the url taken from my layered navigation, let me try and explain:

I created a category called: Cases & Accessories –> Computer Cases –> Full Tower ('Full tower' being the type of products, filtered out)

I get the required URL by using my layered navigation, filtering the type of computer case which leaves me a URL of: XXX/cases-accessories/computer-cases.html?i_form_factor_771_1=6967 where i realised i cannot use special characters in the URL key inside catalog –> manage categories, then I start to create a custom url rewrite

The setup of the custom URL rewrite works perfectly, so I delete the system generated rewrite but when i reindex the catalog url writes, it generates a new system rewrite with a higher ID so uses that over the custom one with now a lower ID.

I tried another option which was to edit the system generated one, which only allows me to change the request path, I do this then reindex but again, the default request path is back on.

Here is a screenshot:
Custom URL Rewrite

You see, the ID for the custom is currently higher but the front end is still showing the system url rewrite. For me to reflect the custom rewrite, i would have to delete the system one.

Futher screenshot reflecting the comments:
enter image description here

This seemed to work, so i now need to change the 1st system rewrite from cases-accessories/computer-cases/full-tower-cases.html to fulltower.html, i try doing this inside the system rewrite, but after a reindex it changes back to cases-accessories/computer-cases/full-tower-cases.html. Any ideas? I created a 3rd url write with the target path of "catalog/category/view/id/1234" but it didnt work.

Best Answer

Not sure if this helps or not but I think i had a similar problem...

find the system created URL rewrite for the category tree you have created

change the redirect to Permanent 301

enter image description here

before you save copy the target path...

Then create a custom URL rewrite placing the copied target path into the custom url rewrite request path.

enter image description here

Update your new target path to where you want the category link to go. (My example goes to a CMS page with a URL key of "dry-eye") I believe this should stop the indexing affecting the link as you technically don't change any of the system rewrite info, instead you add a new rewrite that will apply after the system one.

I could be completely misunderstanding your question though :/