I have update product URL-key but still, the old URL is working. New URL is not working.
Solution applied: ACSD-45168 patch applied. It generates the rewrites, but with the old url, not the new url-key.
This happens for products that have url_key attributes overridden.
"Create Permanent Redirect for old URL" is checked. Still its not creating the redirects.
Please help.
Thank You.
We can't really see the screenshot you attached.
When you open the product in admin, is the new URL key value saved?
Did you try reindexing, clearing cache?
Are there any exceptions in the logs when you save the new URL key value?
Have you cleared your browser cache when checking on the frontend or tried in incognito mode?
Please try these steps to solve the issue:
· If the automatic redirects are not working, you can manually create redirects for the old URLs. You can do this by adding entries directly to the core_url_rewrite table in the database.
Replace 'old-url.html' with your old URL and 'new-url.html' with your new URL key. The redirect_type '301' denotes a permanent redirect.
I have done this for this website https://titandevsquad.com/ , and it worked. I hope this works for you as well.
If the issue persists after trying the above steps, consider contacting Magento support or your development team for further assistance.
If the Magento 2 URL rewrite functionality isn't updating as expected after applying the ACSD-45168 patch and enabling "Create Permanent Redirect for old URL," try:
Reindex URL Rewrites: Manually reindex the URL rewrites to ensure that the changes are applied properly. You can do this by running the following command in the Magento root directory:
php bin/magento indexer:reindex url_rewrite
Clear Cache: Clear the Magento cache to ensure that any cached URL rewrite data is refreshed. You can do this by running the following command:
php bin/magento cache:clean
Check Override Behavior: Review how the URL keys are being overridden for the affected products. Ensure that no conflicting configurations or customizations are causing the issue.
Verify Redirect Settings: Double-check the configuration settings related to URL redirects and ensure that the "Create Permanent Redirect for old URL" option is enabled correctly.
Review Rewrite Table: Check the url_rewrite database table to see if the new URL keys are being generated and stored correctly. Look for any inconsistencies or errors in the rewrite data.
Hello @jasvirkine5e95 ,
It seems like there might be a caching issue or the URL rewrite indexer might not have been triggered after updating the product URL key. Here are steps you can take to troubleshoot and resolve the issue:
Check Cache: Flush the cache to ensure that any old URL rewrite entries are cleared. You can do this using the command:
php bin/magento cache:flush
Reindex URL Rewrites: Reindex the URL rewrites to ensure that the latest changes are reflected. You can do this using the command:
php bin/magento indexer:reindex url_rewrite
Check for Redirects: Ensure that the "Create Permanent Redirect for old URL" option is checked for the product in the Magento admin panel. This will ensure that when the URL key is updated, a permanent redirect is created from the old URL to the new one.
Verify .htaccess Rules: Check the .htaccess file in your Magento root directory to ensure that the rewrite rules are properly configured and that Magento's URL rewriting is enabled.
Check for Custom Redirects: If you have any custom redirect rules set up in your web server configuration (e.g., Apache .htaccess rules or Nginx configuration), make sure they are not conflicting with Magento's URL rewriting.
Check Database: Verify in the url_rewrite table in your Magento database that the old URL rewrite entries have been updated with the new URL key. If not, you may need to manually update or delete these entries.
Test on Different Devices/Browsers: Sometimes, cached redirects or browser history can cause URLs to still resolve to old versions. Test the new URL on different devices and browsers to ensure consistency
If you have any questions, feel free to contact us.