How to set Language Selection with SH404SEF enabled

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

Locked
R2012
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Dec 27, 2012 4:26 pm

How to set Language Selection with SH404SEF enabled

Post by R2012 » Mon Dec 31, 2012 7:15 am

Hello,

I have a problem with my site.

My site has 2 languages, English and Chinese, English as default page. I am using SH404SEF, as you know that I have to disable "System - Language Filter" plugin if SH404EF activated, my problem is that if I disable "System - Language Filter", there is no place to set Language Selection, and every new visitor go to my site for example http://www.mysite.com (English version), the browser redirected to http://www.mysite.com/zh (Chinese Version), and then if I click the EN language flag, it goes to English version correctly without redirection (http://www.mysite.com).

So I am worried if this will be penalized by Search Engines? Anybody knows how to fix the problem please? Thanks.

Kevin.

User avatar
chiappa
Joomla! Intern
Joomla! Intern
Posts: 82
Joined: Wed Oct 26, 2011 6:53 pm
Location: Mostly Northeast Asia
Contact:

Re: How to set Language Selection with SH404SEF enabled

Post by chiappa » Wed Dec 11, 2013 11:37 am

I think I had the same problem using sh404SEF 3.6.0.1422 with "multilingual support". The page automatically redirected to the Joomla default language even if I put the correct language prefix in the URL. After that you could change the language with the "Language Switcher" module to your desired language.

I found out that this was because sh404SEF was choosing the language automatically based on the users browser language. I wanted to have the language show up based on the url.. ex: lang1.mysite.com / lang2.mysite.com.

I don't know what is the best answer but I found out from this post that you can disable the automatic browser language detection by editing the file:

administrator/components/com_sh404sef/classes/router.php

and changing this line (remember backup):

Code: Select all

if ($langFilterParams->get('detect_browser', 1))
to

Code: Select all

if ($langFilterParams->get('detect_browser', 0))
I have no idea if this is the best way to do this.. I just couldn't find a setting for it and was getting tired of fixing this. So I guess you would need to do this every time you update sh404sef. My version is rather old so I don't know how it is with newer versions.

Btw. I don't think this has an effect on Google/SEO. However I did notice that MajesticSEO was saying that the URLs with their language prefixes were redirecting to the default language.. I really don't like this kind of behavior.

Regards,
ToriTori


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”