Jump to content

Characters on language link selection.


frontend

Recommended Posts

Hi,

 

I have installed several languages. When i swith from one language to another.. for instance German to French then some characters are added to the end of the link. Like this..

 

The link in the browser shows this:  https://www.mystore.com/en/?q=%2Fnl%2F

 

Code from the page

<a href="https://www.mystore.com/en/?q=%2FEN%2F" title="English (United States)">

 

Can this be fixed ?

 

 

Regards,

 

 

Bernhard.

Link to comment
Share on other sites

Hi Vekia, Thank you for your reply. 

 

I do not often ask questions, but read a lot, through the years i have seen that you give excellent feedback to questions (so i want to compliment you on that) :)

 

Concerning your remark. No this is not the case.

 

When i type the url directly for instance for the main language NL on https://www.mywebshop.com/nl/  Then i works correctly (nothing added)

Also when i go to the other languages directly by typing in the url in the browser bar then it also works correctly.

 

For instance ;

https://www.mywebshop.com/fr/

https://www.mywebshop.com/de/

https://www.mywebshop.com/es/

https://www.mywebshop.com/en/

 

Only when i change the language through the dropdown menu on the main page these characters are added in de address bar:

 

For instance switch from /nl/ to /de/ with show this in the address bar.  https://www.mywebshop.com/de/?q=%2Fnl%2F

 

Still the /de/ language works correctly but logicly i would like to see the url without the ?q=%2Fnl%2F

 

Still the same thing happens when i then swtich from /de/ to /fr/ the ?q=%2Fnl%2F is added.

 

Any idears? 

Might it have something to do with nginx rewrite rules set through server.conf ?

 

I use the default theme (for many years already)

I use version 1.6.1.12 but i think i had this issue already long before that.

 

Ps.

I noticed that an online SEO checker also sees these urls with the added character and marks them as Unfriendly urls.

This was the main / extra to find out how i can fix this, since it drops the Seo score.

 

Regards,

 

Bernhard.

Link to comment
Share on other sites

case requires inspection, so firstly its necessary to verify the module that is responsible for this dropdown

it is 'blocklanguages' - can you please show .tpl file of this module ? (if your theme overrides it /themes/your-thememodules/blocklanguages/ - this is the right directory with file)

Link to comment
Share on other sites

I Have only one theme which is the defaultbootstrap This is the blocklanguages.tpl content from themes/default-bootstrap/modules/blocklanguages

{*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<!-- Block languages module -->
{if count($languages) > 1}
<div id="languages-block-top" class="languages-block">
{foreach from=$languages key=k item=language name="languages"}
{if $language.iso_code == $lang_iso}
<div class="current">
<span><img alt="{$language.iso_code}" height="11" span="" src="{$img_lang_dir}{$language.id_lang}.jpg" width="16" /> {$language.name|regex_replace:"/\s.*$/":""}</span>
</div>
{/if}
{/foreach}
<ul id="first-languages" class="languages-block_ul toogle_content">
{foreach from=$languages key=k item=language name="languages"}
<li {if $language.iso_code == $lang_iso}class="selected"{/if}>
{if $language.iso_code != $lang_iso}
{assign var=indice_lang value=$language.id_lang}
{if isset($lang_rewrite_urls.$indice_lang)}
<a href="{$lang_rewrite_urls.$indice_lang|escape:'html':'UTF-8'}" title="{$language.name}">
{else}
<a href="{$link->getLanguageLink($language.id_lang)|escape:'html':'UTF-8'}" title="{$language.name}">
{/if}
{/if}
<span><img alt="{$language.iso_code}" height="11" span="" src="{$img_lang_dir}{$language.id_lang}.jpg" width="16" /> {$language.name|regex_replace:"/\s.*$/":""}</span>
{if $language.iso_code != $lang_iso}
</a>
{/if}
</li>
{/foreach}
</ul>
</div>
{/if}
<!-- /Block languages module -->

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

I have installed several languages. When i swith from one language to another.. for instance German to French then some characters are added to the end of the link. Like this..

 

The link in the browser shows this:  https://www.mystore.com/en/?q=%2Fnl%2F

 

Code from the page

<a href="https://www.mystore.com/en/?q=%2FEN%2F" title="English (United States)">

 

Can this be fixed ?

 

 

Regards,

 

 

Bernhard.

Hi, i'm the same problem, are you solved?

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...