- Magento2 Compatibility
- 2.4.x
- Headline
- There are numerous reasons for the error “URL key for specified store already exists”.
- Short Description
- Download and Discuss Premium, BusinessSafemage URL Optimization for Magento 2 2.4.7 version on NullPro Community. It is zip Extention type and 56.9 KB File size. From Safemage URL Optimization for Magento 2 have 1 Description Attachments, 1 discussion, 162 Views.
Migration from Magento 1 to Magento 2 often leads to a problem to save some categories on the backend. There appears this unavoidable error “URL key for specified store already exists”. Our team has thoroughly investigated the problem and come to a conclusion there is no unified and reliable solution to thrash out the problem. Even if you managed to remove all duplicated URLs, the error would surface again after another "Save" procedure.
The extension can help you remedy all post-migration defects relating to URLs. Just in one SSH command. As a result of it, you get:
• all URLs unique
• properly regenerated url_rewrite table (Reindex URL Rewrites)
• bug-free Magento 2 in terms of URLs
Description
There are numerous reasons for the error “URL key for specified store already exists”. We can name the most prominent one, which is the fact there must be some overlapping URL keys between products, categories, and CMS Pages. Magento 1 is indulgent to such cases and would solve the dilemma with duplicated URLs by appending [url_key]-1, [url_key]-2, etc. Magento 2, in turn, considers any duplication as an error.
Migration process involves hundreds or even thousands of duplicated URL keys to wander from Magento 1 to Magento 2. This makes the problem totally immense. To make it worse, the problem can't be addressed by just making URL keys unique. The “url_rewrite” table, as well as the “URL Path” attribute, has to be generated anew.
Furthermore, the indexing procedure is usually accompanied by various code issues of Magento 2. We keep this situation under control with the help of the extension. Hence, if you decide to remove the plugin after solving the
problem with URLs, the errors will find their way back to your Magento 2 again because there will be nothing to stop them.
How to Use
Install the extension following the instruction.
Enter the console and run the command "php bin/magento" to make sure the new commands are available:
• php bin/magento url-optimization😱ptimize-all
• php bin/magento url-optimization😱ptimize-all-force
• php bin/magento url-optimization:unique-url-keys
• php bin/magento url-optimization:generate-url-rewrites*
*A complete optimization effect can be achieved by running just a single command:
• php bin/magento url-optimization😱ptimize-all
The other 3 commands are additional tools for developers mostly. The 'force' command skips forming a MySQL transaction, which might be helpful in case of issues with DB.
The flow of a URL optimization process is displayed in detail in the console and, for convenience, logged in:
var/log/url_optimization.log
Should you have any difficulties you may need help with or any questions, we're always happy to assist (support).
Features
- Utterly addresses the issue with saving of category when “URL key for specified store already exists”
- Capable of making all "URL Keys" unique (works with Products, Categories and CMS Pages in any combination)
- Properly regenerates the "url_rewrite" table
- Fixes a Magento 2 problem with spontaneous duplicating of "URL Path"
- Addresses an issue with the suffix "/" for categories and/or products
No null needed