For more details see how the Unique Product URL for Magento 2 extension works.
Provide extra search engine optimization level with Unique Product URL for Magento 2. The extension allows you to avoid duplicate content issues by creating unique product URLs. With the module, you will be able to:
Now, you are ready to proceed with the Unique Product URL for Magento 2 extension configuration.
To get to the extension's settings go to the Stores → Configuration → Amasty Extensions → SEO Single URL section. There are 5 options to get the module up and running.
Categories Path in Product URL — The option allows you to define the preferred length of product URLs.
By — Here you can tell the extension what method to use when detecting the product URL length. Select between the URL level depth or the Number of characters options.
301 Redirect To Canonical URL — Once you have multiple URLs leading to a single product, you can activate this option to enable automatic redirect to the main canonical URL.
Exclude Category from Product URL — Using this setting you are able to specify category IDs to permanently exclude certain categories from product URLs in your store.
Generate Breadcrumbs According To — This option provides you with the ability to diversify breadcrumbs on your product pages:
When configuration is done, the new URL structure will be the following:
Product URL has the maximum length using the URL depth level criteria. Also, breadcrumbs reflect the current URL. Each product in your store will receive unique URL. That should help you to avoid duplicate content issues and make your store search engine friendly.
Regenerate URLs rewrites in bulk directly from the Magento 2 admin panel. Run regeneration for all or specific categories and products to make their URLs SEO-friendly.
To configure the regeneration process, navigate to Stores → Configuration → Amasty Extensions → URL Rewrites Regenerator.
Enabled - set to Yes to activate the module.
Skip Reindex - choose Yes if you don't want to reindex after each URL regeneration. If enabled, keep in mind that you will have to run reindexation manually when the regeneration process is completed.
Skip Cache Flush and Cache Clean - enable the option to postpone cache flushing and cleaning, similar to reindexation.
Include Categories to Regeneration - set to Yes to rewrite URLs for categories.
Choose Category Range to Regenerate - enable the option if you want to apply URL updates for multiple categories.
Category ID Range to Regenerate - here you can specify the particular range of categories to regenerate (e.g. 1-20)
Choose Category IDs to Regenerate - if enabled, you'll be able to set particular category IDs and implement the changes to them.
Category IDs to Regenerate - provide comma-separated list of IDs to rewrite URLs (e.g. 25,47,56).
Include Products to Regeneration - select Yes to add product URLs to the regeneration queue.
Choose Product Range to Regenerate - enable the feature if you want to regenerate links for multiple products at once.
Product ID Range to Regenerate - provide the range or products to process (e.g. 1-200).
Choose Product IDs to Regenerate - enable the option to regenerate URLs for specific products.
Product IDs to Regenerate - fill in comma-separated product IDs (e.g. 12,25, 36).
Regenerate URL Rewrites for Store Views - choose all store views or a particular one to regenerate URLs.
Start Regeneration - click the button to run regeneration.
When regeneration starts, you can keep an eye on the process using the information in popups. If you regenerate URLs for both categories and products, you will see the results separately.
For categories it looks like this:
Click Next Step to regenerate URLs for products and view the results.
Also, if you want to stop regeneration, you'll have to confirm your decision in the warning popup.
If you reload the page or close the window (intentionally or accidentally), the process will still run in the background. You'll see the progress below the Start Regeneration button. Stop the process if needed.
All extension actions can be executed using the command line. It can be useful in cases of auto-deploy or automatic updates, during which some rewrites may be required.
Available CLI commands:
amurlrewrites:regenerate
- running this command without the options will regenerate URL rewrites for all products in all stores. After execution, reindex and cache flushing and cleaning will be executed as well.
Available options:
store-id
- start regeneration only for a specific store, e.g store-id = 2;
entity-type
- select which entity to process - product or category;
no-reindex
- do not start reindex after the command process (by default it starts);
no-cache-flush
- do not start the cache flushing (by default it is launched);
no-cache-clean
- do not start the cache cleaning;
ids-range
- set the range of category or product IDs for regenerating URL rewrites, e.g. 100-123;
ids
- specify category or product IDs for regeneration, separated by comma e.g 1,2,3 .