8

We have a multi-store Magento 2.1.4 installation, with 3 stores, and in recent weeks we've noticed that our category URLs will some times include one of our store code's prepended with "-categories/" to all of our URLs.

Eg. az-categories/wheel-brake-tire/brake.html when it should be wheel-brake-tire/brake.html where az is the store code.

After investigating this further we discovered that any time we save a category the system generates more URLs like this.

It creates these URLs for each Store ID but only adds one Store Code to the URL. All stores will have a URL of az-categories/wheel-brake-tire/brake.html One row where store_id = 1, another where store_id = 2 and a third where store_id = 3.

We don't want this occurring on any of our sites.

We've disabled our custom extensions in our local environment and it still occurs. We also tried to prevent this by commenting out the Magento code in vendor/magento/module-catalog-url-rewrite/Model/CataegoryUrlRewriteGenerator.php as a test but it still occurred.

Does anyone know how to resolve this so that the system no longer generates these extra URLS and returns our categories are back to normal?

Thanks.

  • Try Admin -> Stores -> Configuration -> General -> "Enable Single-Store Mode" set to Yes & Check Go to Admin -> Stores -> Configuration -> General -> Web -> Url Options -> Add Store Code to Urls should be No – Ankit Shah Jun 16 '17 at 3:25
  • 2
    Why would we enable single store mode if we're using multiple stores? – Zachary Craig Jun 16 '17 at 19:44
1

You need to disable Stores -> Configuration -> General -> Web -> Url Options -> Add Store Code to Urls option and clean the cache

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.