Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a site,The site have lot of visitors from international.The site content currently in English.I want to change language dynamically by using PHP code,this done based on the requesting IP address. If the IP address is in US Countries, in server side automatically detect loading language as English. Is this method good for SEO? Is there any alternative solution for this?,Please suggest me.

Thanks in Advance.

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

I want to change language dynamically by using PHP code,this done based on the requesting IP address.

Please avoid automatic language detection based upon origin IP or, if you insist upon using this technique, make it easy for users to select a different language - you will inevitably find that some of your users' IP addresses do not accurately indicate the language which they prefer to use.

The Accept-Language header provided by the user's browser is a better choice for language selection.

Is this method good for SEO?

The goal of any optimization efforts should be to make one's site easy for search engines (as well as visitors) to retrieve and parse; introducing a potential inconsistency would not be advisable.

Ideally, your site will reflect a 1:1 URI:content mapping to allow search engine spiders (which will not set cookies or reliably use a specific IP address) to associate each language's set of URI's with the content specific to the language.

Related questions:

share|improve this answer
    
Thanks for great information...Please explain what is 1:1 URI:content mapping? –  Abdul Majeed Oct 23 '11 at 11:56
    
For every distinct piece of content (including alternate translations) a distinct Uniform Resource Identifier (URI) (and preferably only one URI) may be used to access the content. –  danlefree Oct 24 '11 at 1:44
add comment

Google generally recommends not to use IP-location as a way of automatically redirecting users to their preferred version:

To make all of your site's content more crawlable, avoid automatic redirections based on the user's perceived language. These redirections could prevent users (and search engines) from viewing all the versions of your site.

Keep in mind that Google - and most other search engines - generally crawl from a single location, so any automatic redirect will lock them into a specific part of your website. On the other hand, if you have separate URLs for all language versions of your site that do not automatically redirect, then search engines will generally be able to crawl and index all versions of the website. It's fine to suggest a specific version to users (say with a JavaScript overlay or "butter-bar"), then those users will be able to reach those language versions faster, but you would not be forcing them.

share|improve this answer
    
The site is not re-directing.The content will loaded will loaded dynamically based on the IP. –  Abdul Majeed Oct 23 '11 at 10:25
    
The same applies to when you swap out the content for content in the language of the user's perceived language. –  John Mueller Oct 24 '11 at 7:38
add comment

I think you have a lot of solutions to do what you want but the one you said has a little issue (like many other solutions). Infact, think to the follow situation: A man who is english is connected from France. Now your website is going to redirect him to the french version but it should redirect the user to the us/en version. So he (and many others users) will be confused and a little bit bored by this situation.

share|improve this answer
    
@AurelioDeRosaT‌​he site is not re-directing to the corresponding language folder.It will dynamically detect languages and loaded in same page. –  Abdul Majeed Oct 23 '11 at 10:30
    
@AbdulMajeed It's the same thing. How do you detect the language? Or you're basing on IP, or the locale language set by user or whatever, this is not a 100% method. –  Aurelio De Rosa Oct 23 '11 at 10:41
    
From global variable $_SERVER["REMOTE_ADDR"].Then find out corresponding country –  Abdul Majeed Oct 23 '11 at 11:08
    
@AbdulMajeed So do you think it's a good method? You're totally wrong. What if the user use a proxy? Or, as I said, he is in a different nation from his native nation? Definitely this is not a 100% method. –  Aurelio De Rosa Oct 23 '11 at 11:12
    
@AurelioDeRosaY‌​es, I agreed with you.I also ref answer of danlefree.Now i cleared Thank you. –  Abdul Majeed Oct 23 '11 at 11:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.