Mobile app version of vmapp.org
Login or Join
Odierno851

: Serving the same content in different languages over the same URL There are a couple of questions about this topic here, but I couldn't find an answer that is specific to my question. So,

@Odierno851

Posted in: #Language #Seo #Url

There are a couple of questions about this topic here, but I couldn't find an answer that is specific to my question.

So, I'm building a website which currently only supports one language, but I want to make it bi-lingual, meaning every page will be available in two languages. Each page will have the same contents, only translated in two languages. What I want to do is detect the language of the browser in my PHP-script and serve the different versions based on that (there will probably be a button to switch the language as well). However, with that approach, both versions of the same page would share one URL (e.g. example.com/about would show either versions of the page, depending on the user's browser language and/or a session/cookie). Is that bad for SEO-purposes? And are there any other downsides that I'm not aware of?

I'm asking this as given the way the project is laid out, it would be not that easy to make the second version of each page available over a different URL (e.g. example.com/en/about or en.example.com/about). If the approach above is not advisable, would it be a viable alternative to determine the language by a URL parameter, e.g. example.com/about?l=en (where the script defaults to my local language if no parameter is passed)?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Odierno851

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

What I want to do is detect the language of the browser in my PHP-script and serve the different versions based on that (there will probably be a button to switch the language as well). However, with that approach, both versions of the same page would share one URL (e.g. example.com/about would show either versions of the page, depending on the user's browser language and/or a session/cookie). Is that bad for SEO-purposes?


The problem here is that search engine crawlers use basic settings and no cookies by default. For example, if you have example.com/about and it displays english text if a cookie and browser language are set to a certain value and it displays french text if nothing is set then search engine crawlers in this case will only be able to scan french text. This means the english text will never be indexed.

If you really want to know what actual settings crawlers use, you can use a PHP script to detect the language, cookies, and IP address the search engine uses.


would it be a viable alternative to determine the language by a URL parameter, e.g. example.com/about?l=en (where the script defaults to my local language if no parameter is passed)?


This setup is better than your first idea since the search engine crawler can index each and every page without a special setup (such as having certain cookies or language set).

What I would suggest is using mod_rewrite module if you have apache installed to make friendly URLs such as these:
example.com/en/about http://example.com/fr/about example.com/it/about

Here's more info on how to start using the module:
www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme