Magento多个商店 - 从url中删除?store =

I am trying to shorten the url when the frontend is being changed to a different language. I already managed to shorten it a bit through setting <?php echo $_lang->getCurrentUrl() ?> to <?php echo $_lang->getCurrentUrl(false) ?> but it still shows the $store=.

I just want my urls to be like that: domain.com/de and domain.com/en.

One possible solution is to change the your page/switch/languages.phtml file

Find the line that reads

echo $_lang->getCurrentUrl()

And replace with

echo $_lang->getCurrentUrl(false)

Option 2

Go to System -> Configuration -> Web -> URL Options and set the 'Add Shop Code to URLs' option to Yes

This will make the urls to the store appear like the following:

www.myshop.com/otherstore/

www.myshop.com/default/

To edit the names of your stores to be SEO friendly, go to System -> Manage Shops


Quelle: https://magento.stackexchange.com/questions/53386/magento-multistore-store-and-from-store-in-url/53426#53426

Assuming your store code are 'de' and 'en' for the said stores, you just have to adapt your configuration under

System > Configuration > Web > Add Store Code to URLs

<?php if(count($this->getStores())>1): ?>
<div class="language dropdown">
<div class="dropdown-toggle cover">
    <!--<div class="icon" style="background-image:url(<?php echo $this->getSkinUrl().'images/flags/' . $this->htmlEscape(Mage::app()->getStore()->getName() .'.png'); ?>)"></div>-->
    <div class="language-inner">
        <div class="value">
            <?php echo Mage::app()->getStore()->getName(); ?>
        </div>
    </div>
</div>

<div class="dropdown-menu left-hand" onchange="window.location.href=this.value">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <a href="<?php echo $_lang->getCurrentUrl(false) ?>" class="currency_icon<?php if($_lang->getId() == $this->getCurrentStoreId()):?> selected <?php endif; ?>">
            <!--<span class="icon" style="background-image:url(<?php echo $this->getSkinUrl().'images/flags/' . $this->htmlEscape($_lang->getName() .'.png'); ?>)"></span>-->
            <?php echo $this->htmlEscape($_lang->getName()); ?>
        </a>
    <?php endforeach; ?>
</div>