?
avatar iamrobert
iamrobert
1 May 2015

If the default site language "remove url language code" is checked - the mod_language language switcher still adds the language code.

I have applied this to J3.4:
2286521#commitcomment-10992787

The above correctly removes /tw/ from rel="alternate":

  <link href="http://localhost/htw3/index.php/about/doctors" rel="alternate" hreflang="zh-TW" />

However the language switcher - still adds /tw/:

<div class="mod-languages">
<ul class="lang-inline">
  <li class="" dir="ltr"> <a href="/htw3/index.php/tw/about/doctors"> 中文 </a> </li>
  <li class="lang-active" dir="ltr"> <a href="/htw3/index.php/en/about/doctors"> English </a> </li>
</ul>
</div>

Any ideas?
avatar iamrobert iamrobert - open - 1 May 2015
avatar iamrobert iamrobert - reference | - 1 May 15
avatar infograf768
infograf768 - comment - 1 May 2015

The behaviour IS correct. No bug here at all
For a site where en-GB is the default site and Remove URL Language Code is set to Yes, we will get as alternate:

 <link href="http://localhost:8888/testwindows/trunkgitnew/" rel="alternate" hreflang="en-GB" />
  <link href="http://localhost:8888/testwindows/trunkgitnew/de/" rel="alternate" hreflang="de-DE" />
  <link href="http://localhost:8888/testwindows/trunkgitnew/it/" rel="alternate" hreflang="it-IT" />
  <link href="http://localhost:8888/testwindows/trunkgitnew/es/" rel="alternate" hreflang="es-ES" />
  <link href="http://localhost:8888/testwindows/trunkgitnew/mk/" rel="alternate" hreflang="mk-MK" />
  <link href="http://localhost:8888/testwindows/trunkgitnew/ta/" rel="alternate" hreflang="ta-IN" />

and the switcher will have the /en/ because it is After clicking on the switcher that the url language code is removed.
Alternate will work as desired.

avatar zero-24 zero-24 - change - 1 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 1 May 2015
Category Multilanguage
avatar iamrobert
iamrobert - comment - 1 May 2015

My reason for asking is won't the redirect affect SEO:

"The link to "http://localhost/htw3/index.php/tw/" has resulted in HTTP redirection to "http://localhost/htw3/index.php/".

Search engines can only pass page rankings and other relevant data through a single redirection hop. Using unnecessary redirects can have a negative impact on page ranking."

Redirects also slow down page load.

avatar infograf768
infograf768 - comment - 1 May 2015

We have one redirect only.

avatar joomla-cms-bot joomla-cms-bot - close - 5 May 2015
avatar infograf768 infograf768 - change - 5 May 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-05-05 06:54:10
Closed_By infograf768
avatar infograf768
infograf768 - comment - 5 May 2015

Closing. Thanks for your concern.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6874.

avatar infograf768
infograf768 - comment - 5 May 2015

Add a Comment

Login with GitHub to post a comment