cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong URL in LanguageSwitcher

SOLVED

Wrong URL in LanguageSwitcher

Hello community,
 
I hope you understand my english Smiley Indifferent
I've searched for hours, but not found a solution. I hope you can help me.

I've 4 StoreViews (ES,DE,EN,FR) and the LanguageSwitcher is activated.
Unfortunately, the URL of each language is wrong.

The only change I've made in the language.phtml, was to add the "false" so that "? ___ from_store = en" is removed.

<?php foreach ($this->getStores() as $_lang): ?>                
                <a href="<?php echo $_lang->getCurrentUrl(false) ?>"> ... </a>
<?php endforeach; ?>

My problem is that the query is displayed twice in the URL and thereby it throws a 404.

e.g.

http://myDomain/&___store=en?___store=en

http://myDomain/&___store=encategory/product?___store=en

instead of

http://myDomain/?___store=en

http://myDomain/category/product?___store=en

Can someone tell me how to remove the "& ___ store=en" from the URL?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Wrong URL in LanguageSwitcher

Hi,

 

Please try to disable it in the admin: System -> Configuration -> Web -> Add Store Codes to URL

 

or  you can check if this extension helps you

 

Thanks

View solution in original post

4 REPLIES 4

Re: Wrong URL in LanguageSwitcher

You need these parameters to be able to switch between store views if they are using same domain.

 

However you may setup subdomains for it  - in this case you will change url at the admin System->Configuration->Web for store view base urls and you wont have this issue.

Re: Wrong URL in LanguageSwitcher

I thought you needed only "?___store=en" instead of "&___store=en?___store=en" at the end of the URL to switch between the store views.

It is necessary to create a subdomain for each store view? Each URL key in the categories and products are unique in the store views. At the beginning it worked but now magento adds "&___store=en" after the baseURL.

 

 

 

Re: Wrong URL in LanguageSwitcher

Hi,

 

Please try to disable it in the admin: System -> Configuration -> Web -> Add Store Codes to URL

 

or  you can check if this extension helps you

 

Thanks

Re: Wrong URL in LanguageSwitcher

I'm trying to add the store switcher variable code "?___store=retail" to ALL my URL's 

 

- This is to resolve an issue with clients sharing individual URL's that may not be be available in a given store view.  

- Adding the store switcher code to the end of each URL will ensure that the users hit the intended store view page.  

 

1) Every page product page URL would need to look like this:

storeurl.com/product_1.html?___store=retail

 

2) Every Magento SERP page would need to look like this

storeurl.com/products.html?attribute_1=83&attribute_2=256&___store=retail

 

3) CMS pages would also need to have the code added:

storeurl.com/cmspage.html?___store=retail

 

Your assistance would be extremely helpful, 

Thanks in advance,