cancel
Showing results for 
Search instead for 
Did you mean: 

Create Permanent Redirect for old URL not working - Magento 2

Create Permanent Redirect for old URL not working - Magento 2

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.

Screenshot from 2024-02-23 15-41-40.png

Please help.

 

Thank You.

3 REPLIES 3

Re: Create Permanent Redirect for old URL not working - Magento 2

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?

Founder at https://agency418.com

Re: Create Permanent Redirect for old URL not working - Magento 2

Please try these steps to solve the issue:

  • Ensure that you have reindexed your Magento store. Reindexing is essential for applying URL changes and ensuring the redirects work correctly. You can reindex from the Magento Admin Panel by navigating to System > Index Management and selecting all indexes needing reindexing.
  • Clear your Magento cache after making changes. Go to System > Cache Management, select all caches and refresh or flush the cache.
  • Verify that the rewrite rules are correctly generated. You can do this by going to Marketing > URL Rewrites in the Magento Admin Panel. Look for the old and new URLs, and check if the redirect is set up correctly.
  • Some third-party modules may interfere with URL rewrites and redirects—Disable third-party modules individually to see if they are causing 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.

  • Double-check the implementation of the ACSD-45168 patch. Ensure it is correctly applied and there are no issues with the patch itself. There may be compatibility issues with your current Magento version.

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.

Re: Create Permanent Redirect for old URL not working - Magento 2

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:

  1. 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:

    bash
    php bin/magento indexer:reindex url_rewrite
  2. 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:

    bash
    php bin/magento cache:clean
  3. 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.

  4. 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.

  5. 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.