I want to redirect all product URLs without a category path to their category path URLs for SEO purposes.

Example - Redirect mywebsite.com/product-name.html to mywebsite.com/category1/sub-category/product-name.html.

Please help.


Please change your catalog configuration.

Admin -> Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> Use Categories Path for Product URLs to NO

php bin/magento indexer:reindex

php bin/magento cache:clean

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.