I have managed to add a prefix in the url of my site, now my site allows entering the Shop page with these two urls: misitio.com/tienda

and with the prefix: misitio.com/us/tienda

When I enter with the first URL everything works correctly, the categories and products are displayed on the SHOP page. (see image 1)

But when I enter with the second URL, it only shows me the categories (see image 2)

The strange thing is that when I enter with the URL2 and enter a category the products are shown (see figure).

I need your help so that when I enter URL2 the categories and products are displayed as it happens when I enter URL1.

It will be a problem with woocommerce or I am missing something to do.

The prefix I have done by changing by rewriting the rules in the structure of the page in function.php. thanks for your support. enter image description here enter image description here

1 Answer 1


I use the following code to add the prefix:

function change_permalinks() {
 global $wp_rewrite;
 $prefix = 'us';
 $wp_rewrite -> use_trailing_slashes = false;
 $wp_rewrite -> $prefix . $wp_rewrite -> page_structure.'/%pagename%';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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