How to reindex the URL rewrites?

in M2 reindexer have’t URL rewrite.
but i TRUNCATE tables catalog_url_rewrite_product_category and URL_rewrite
so all page 404 error.
how to rebuilding? like M1 shell/indexer.php --reindex.

How to reindex Magento 2 data from the command line?

M2 can’t rebuilding URL index.
i used this cil…but tables is null

Magento 2 updates the catalog_url_rewrite_product_category table automatically on a product and category saving:

You should restore the catalog_url_rewrite_product_category table from a backup, and never truncate it again.

thank you guy.
but i’m have’t backup.
any idea can reindex url_rewrite and tables catalog_url_rewrite_product_category ?

Resave each product.
For example, try to do a group product updating using the backend product list tools for it.

i have 6K SKU…
too much…
have easy idea?

Besides the batch product updating by on backend product list screen, you can also try to execute a simple standard export and then re-import: for example, re-import only sku and url_key attributes, and Magento should reindex the rewrites.

1 Like

so,i have easy idea.
is resave category…