0

该网站有 2 种语言:法语和荷兰语,由 2 个商店视图表示。法语是默认的。对于我们的 SEO 工作,我们需要以下网址:

  1. 法语 - http://www.domain.com/category/product
  2. 荷兰语 - http://www.domain.com/nl/category/product

System -> Configuration -> Web -> Add Store Codes to URL 是全有或全无设置。我们只需要为默认商店关闭它。

有什么建议么?

4

2 回答 2

2

我开发了一个扩展程序,允许您直接从 Magento Admin 隐藏默认商店代码。

在此处输入图像描述

更多信息在这里:https ://github.com/jreinke/magento-hide-default-store-code

于 2014-10-16T06:58:28.313 回答
0

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

于 2012-08-14T10:44:30.407 回答