2
votes

The site has 2 languages: English and French, 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. English - http://www.domain.com/en/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. I’ve done a lot of searching through the forums and wiki but there’s nothing on the subject.

Please any sugestions?

5
I don't think there is a way without some custom coding. Per chance it could be done with small effort and xml routing settings, but I haven't digged through that yet.user3154108
Maybe this link can help you: [store-code-in-url-for-every-store-view-except-for-default][1] [1]: magento.stackexchange.com/questions/8126/…user3154108
i have tested it but no resultkarim karimeri

5 Answers

6
votes

Finnaly i solved this magic probleme , i hope that's save others persone here is the details :

1- Download the zip existe in this page : https://github.com/Knectar/Magento-Store-Codes

2- unzip the file and put the folder called "Knectar" in {app/code/community/} and Knectar_Storecodes.xml file in {app/etc/modules}

3- In your backoffice go to "System > Tools > Compilation" and click the rebuild button

4- always in backoffice got to "System > Configuration > Web > URL options" and set the attribute "and default store view" to No and save the configuration

5- Clear your cach magento and enjoy your application :) .

3
votes

I had the same problem and I have developed an extension for that.

enter image description here

It is available on GitHub: https://github.com/jreinke/magento-hide-default-store-code

0
votes

I didn't find a quick solution to your problem, but I see that's possible through 2 steps :

1 / Using the advise commented by @user3154108 and trying this tip https://magento.stackexchange.com/questions/8126/store-code-in-url-for-every-store-view-except-for-default 2 / For SEO SITEMAP, it's possible to override the following file

app/code/core/Mage/Sitemap/Model/Sitemap.php
public function generateXml()
{
    ...
}

and replace the default store code by NULL. For more details try to look at this post : http://alanstorm.com/generating_google_sitemaps_in_magento

0
votes

I was having the same problem and I had already selected to not show store code in url in the config. I also didn't want to install an extension just to handle something this minor. Here's my EASY solution:

Copy app/code/core/Mage/Catalog/Block/Widget/Link.php to app/code/local/Mage/Catalog/Block/Widget/Link.php

Search for (line 91 in Magento 1.7.x / line 100 in Magento 1.9.x)

$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();

And modify to

$this->_href = $this->_href;

Upload and save your changes and you'll now not have your widget (dynamically) inserted links getting appended with ?___store=default.

Credit: DesignHaven

-1
votes

Under System -> Configuration -> Web -> URL Options you change "Add Store Code to Urls" to "NO" as on the attached screenshot enter image description here