Part of the EllisLab Network
   
 
referencement, best practices for multilanguage sites
Posted: 22 March 2008 06:35 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  109
Joined  08-26-2006

Hi,

For a multilanguage site I want to implement an automatic language attribution in the default controller. But I wonder whether my solution using the URL helper function redirect() will not perturb Google referencing the pages. I’ve already had bad
experiences using redirects (that was a HTML refresh, though).

My solution

class Front extends Controller{

    
function index()
    
{
        $langs
= $this->agent->languages();
        
        
// the critical part of it
        
redirect($langs[0]);
    
}
}
class En extends Controller {

    
function _remap()
    
{
        $lang
= 'en';
        
        
$data['menu'] = $this->_menu($lang);
        
        
$this->load->view($this->html_template, $data);
    
}
}
class Fr extends Controller {

    
function _remap()
    
{
        $lang
= 'fr';
        
        
$data['menu'] = $this->_menu($lang);
        
        
$this->load->view($this->html_template, $data);
    
}
}

The above gives me :
1. no routing required
2. I obtain short URLs http://www.site.com/fr/content, http://www.site.com/en/content
3. I need the language detection only in the front controller
4. Google has a 1:1 relation for address and content

Do You think that my solution will work out for the referencement?
Is there a risk that Google or any other motor will reject my site due to the redirect?
Do You have a better solution wink

Profile
 
 
Posted: 01 April 2008 09:24 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Avatar
Total Posts:  12
Joined  03-07-2008

Are you talking about Google’s translate engine?  Or Google’s search engine indexing each of the languages?  There shouldn’t be a problem with the search engine indexing.  However, if you are talking about using the translate engine, then read on.  (Your post wasn’t clear on which you were speaking of.)

Accessing Google’s translate engine without using the script snippet they provide is actually a violation of Google’s Terms of Service, and they can blacklist your site if you are caught.  This is pretty much the case with every free translation engine out there, as I have done extensive research on this.

Also, if your site requires the use of sessions, the sessions will be rendered useless when you call Google translate, or any other translate engine.

I had actually come up with a workaround for that and coded it into a nice class, however, further research into the issue revealed the legal issues that were involved.  Trust me, it isn’t worth it.

Here’s what I did, and what I recommend.  Hard code the language translations.  I set up a language file for each language I wanted the site to use.  All the views were templated with variables so that they could be replaced by the appropriate language.  If the site is using static data and is not depending on constantly changing user input that needs constant translation (like a wiki) then this is definitely the best route.  The translation sites will add between 3 and 10 seconds, sometimes more, to each page load.  Hard coding it makes it lightening fast.  Nobody likes to wait, and the wait could make people not want to visit the site.  It’s also best to use a professional translation.

 Signature 

Rhapdog
Freelance PHP Programmer

Profile
 
 
Posted: 03 April 2008 01:06 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  109
Joined  08-26-2006

I have all the strings of my site already translated. I am talking about Google’s search engine indexing. One of my clients had a HTML refresh installed and Google did not index it’s site, my guess because this kind of technique is also used by spam sites.

Since my new site will completely be based onto the redirect function (every visit of the home page is redirected to one of the languages) and I want the site and it’s content to be indexed by Google & Co., I want to be sure that it’ll work.

Profile
 
 
Posted: 03 April 2008 06:00 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Avatar
Total Posts:  12
Joined  03-07-2008

Redirects themselves are not considered by Google to be bad.  However, redirects within javascript generally are not detected by the search engine and it is best to duplicate them in a <noscript> tag. 

If you would like more information on exactly why Google removes sites from it’s indexing, read Google’s Webmaster Guidelines at http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=35769

You might also want to take a look at their section on redirects at http://www.google.com/support/webmasters/bin/answer.py?answer=66355

 Signature 

Rhapdog
Freelance PHP Programmer

Profile
 
 
   
 
 
‹‹ Mosso Hosting      In Texas ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61049 Total Logged-in Users: 17
Total Topics: 73853 Total Anonymous Users: 0
Total Replies: 398362 Total Guests: 321
Total Posts: 472215    
Members ( View Memberlist )