0
votes

The site has 2 languages: French and Dutch, represented by 2 store views. French is the default one. For our SEO efforts we need to have the following urls:

  1. French - http://www.domain.com/category/product
  2. Dutch - http://www.domain.com/nl/category/product

System -> Configuration -> Web -> Add Store Codes to URL is the all or nothing setting. We just need to turn it off for the default store only.

Any suggestions?

2

2 Answers

2
votes

I have developed an extension that allows you to hide the default store code directly from Magento Admin.

enter image description here

More information here: https://github.com/jreinke/magento-hide-default-store-code

0
votes

After short investigation I found that it is possible, but it is not programmatically enabled by default.

Take a look in this file from app/code/core/Mage/Core/etc/system.xml:

// around line 1092 - magento v1.6.2.0
<use_store translate="label">
    <label>Add Store Code to Urls</label>
    <frontend_type>select</frontend_type>
    <source_model>adminhtml/system_config_source_yesno</source_model>
    <backend_model>adminhtml/system_config_backend_store</backend_model>
    <sort_order>10</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>0</show_in_website>
    <show_in_store>0</show_in_store>
</use_store>

This three lines indicates configuration visibility in current scope

<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>

Unfortunately you cannot simply change those values to 1, because magento after upgrade overwrites all core files from app/core and you will lose all setup that was done there.

You can override config by overriding module system. Check: How to override a Magento administration panel?

I am a new with Magento world. Perhaps there's an easier way to do it

Greetings Marcin