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.

4 REPLIES 4

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.

Avid learner and technical marketer at devrims.com

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

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.