简体   繁体   中英

Adding Magento System URL Rewrite

I accidentally deleted some System URL rewrites while attempting to do some 301 redirect magic (ie getting one subcategory to direct to another category because they were duplicates but in different parent categories).

After deleting these system URL rewrites I realised that the URLs aren't "pretty" for SEO purposes. For example I deleted a system URL rewrite that was:

flow-meters

/catalog/category/view/s/flow-meters/id/481/

basically, now every time I click on this category, I get /catalog/category/view/s/flow-meters/id/481/ whereas I want the URL to say something similar to sprayers/flow-meters . Is there a way to add this into Magento via the dashboard? Or do I have to play around with the database tables?

Any help would be appreciated.

You should be able to regenerate Magento's standard URL rewrites by reindexing your system. Specifically, the Catalog URL index needs rebuilding.

You can do this programmatically via the CLI interface with the following

$ php shell/indexer.php --reindex catalog_url

Or, per your question, via the backend backend admin application at

System -> Index Management

I went into core_url_rewrite table inside the database and manually inserted rows to match the category IDs. Then clearing the cache in System --> Cache Management seemed to make the system work fine.

Take a backup of core_url_rewrite table and truncate it. Then clear cache and then reindex the "Catalog URL Rewrites" from magento Index Management configuration.

Also before reindex ensure the setting of "Search Engine optimization" in web setting is enabled.

This way I solved my problem.

Hope this will help

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