elgentos / magento2-regenerate-catalog-urls

This extension adds console commands to be able to regenerate; a product rewrite URL based on its url path; a category rewrite URL based on its url path; a category URL path based on its URL key and its parent categories.
MIT License
266 stars 75 forks source link

Root category url causes redirect loop #20

Closed ctadlock closed 4 years ago

ctadlock commented 5 years ago

image

What is the purpose of this rewrite? I have to delete the row, otherwise a request to the home page of my store causes an infinite redirect loop.

ctadlock commented 5 years ago

The same bug was reported here: https://github.com/experius/Magento2-Module-Experius-ReindexCatalogUrlRewrites/issues/10

peterjaap commented 5 years ago

Please report the bug in the magento/magento2 repo. The reason why this happens in this extension and in the one you mention is because it's not in the extension. These extensions only trigger generation of the rewrite URL's, it doesn't make the actual rewrites, Magento does.

peterjaap commented 4 years ago

@ctadlock sorry to have jumped the gun by blaming Magento back in November. I just ran into this myself and it turns out you're right. I now added a level filter to skip the root categories when letting Magento generate the URLs; https://github.com/elgentos/regenerate-catalog-urls/commit/6a31dc88c8eba00bca1bdea7f0310283d02d792c

Again, sorry to have dismissed your comment so easily.

gototagsdev commented 4 years ago

@peterjaap This doesnt seem to have resolved the issue. My category id:2 is Default Category; its parent id:1 is Root Category.

Is this a multi-store issue? I have two websites; one for USA and one for Canada.

I have to run this sql to remove the record that causes the home page redirect.

DELETE FROM `url_rewrite` WHERE `entity_type` = 'category' AND `request_path` = '/';

url_rewite...

image

catalog_category_entity...

image

admin...

image

peterjaap commented 4 years ago

@gototagsdev ID's shouldn't matter, I'm filtering on level greater than 1. Judging from your screenshots, this should exclude the Default Category (with ID 2 and level 1). Are you sure you're using the latest version?