WooCommerce product permalink changed

my product structure was like the following before:

https://example.com/producto/product-name/

Now, I've done some updates to the translations and this is how the product urls appear now:

https://example.com/product/product-name/

(without the 'o' in product)

It's actually OK to me, but on my shop page the URLs kept the final 'o', redirecting to 404 my products. How can I fix this?

Topic woocommerce-offtopic permalinks Wordpress

Category Web


the easiest and best way to do that is to edit your .htaccess file.

Your .htaccess file is located in your FTP under the folder public_html (usually).

This way, when a user is trying to access your old url /producto/ it will immediately change to /product/ as a 301 permanent redirect.

In that file, you will see these lines-

RewriteEngine On
RewriteBase /

After those line, try adding this line-

RewriteRule ^producto/(.*) product/$1 [R=301,L]

I didn't test this code but i believe it should do the trick

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.