locked
Search Engines and Multilanguage Websites RRS feed

  • Question

  • User1121634802 posted

    hello

    actually i've developed a asp.net 2.0 multilanguage website by using localization incl. resource files.
    now i've got a problem with the following question:

    how can search engines detect my multilanguage website-content ?
    can they detect the resource-files ?

    thanks for any help

    cheers
    lutz

    Tuesday, February 9, 2010 8:40 AM

All replies

  • User2050679644 posted

    search engines are not going to read your resource files, but you can set the language of the page through meta tags like:

    <META HTTP-EQUIV="Content-Language" CONTENT="en-US">
    Tuesday, February 9, 2010 9:18 AM
  • User1121634802 posted

    hello icecape67


    thanks for your reply.

    that's all ? only add meta tags to my master-page and that's it ?

    i guess i need url-rewriting to deligate the search engine crawler to the french content by separeted url like www.mysite.com/fr/site.aspx 

    do i ?

    thanks for help

    lutz


    Wednesday, February 10, 2010 5:54 AM
  • User2050679644 posted

    hi Lutz,


    that will help as well, or to a different subdomain like "fr.mysite.com". Make sure that the content for all languages is crawlable, dont rely on redirects or cloacking to do it or you may get a penalty


    Wednesday, February 10, 2010 7:17 AM
  • User-424706843 posted

    This is very interesting for me as I am in the same situation 


    I don't use query string parameters but Session and a cookie to store the user's language. At the moment my website is in three different languages, sharing the same pages (ad example ~/Default.aspx) and using global/local resources.


    How can I base my url rewriting on the culture selected by the user?


    This is the code that I use for the localization (without url rewriting)


    public class BaseClass : Page
        {
            protected override void InitializeCulture()
            {
    
                //retrieve culture information from session
                string culture = Convert.ToString(Session[Global.SESSION_KEY_CULTURE]);
                
    
                //check whether a culture is stored in the session
                if (culture.Length > 0)
                {
                    Culture = culture;
                }
                //check if the culture is in a cookie
                else if (Request.Cookies["CulturePref"] != null)
                {
                    culture = Request.Cookies["CulturePref"].Value;
                }
                else culture = Global.DEFAULT_CULTURE;
    
                //set culture to current thread
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
    
                //call base class
                base.InitializeCulture();
            }
    
        }



    Wednesday, February 10, 2010 11:58 AM
  • User1121634802 posted

    hello at all


    thanks for replay


    that's the same way like i do :)

    override InitializeCulture, use session and cookies.

    so i have the same question like DavideDarko.


    how can i make my mulitlanguage ressources visible for the search engine crawlers, when all my pages in the same folder and each page share two (fr and en) resource-files ?


    thanks for any help

    lutz

    Wednesday, February 10, 2010 2:16 PM
  • User-424706843 posted

    I think I have solved it.

    I have used urlrewriter.net http://urlrewriter.net/

    And specified the following rules in the web.config

            <rewrite url="~/en/(.*)" to="~/$1.aspx"/>
            <rewrite url="~/sv/(.*)" to="~/$1.aspx"/>
            <rewrite url="~/it/(.*)" to="~/$1.aspx"/>

            <rewrite url="~/en/(.*)" to="~/$1.aspx"/>

            <rewrite url="~/sv/(.*)" to="~/$1.aspx"/>

            <rewrite url="~/it/(.*)" to="~/$1.aspx"/>


    Of course you can be more specific, using other rules.

    Let me know if it's working for you

    Thursday, February 11, 2010 12:38 AM
  • User2050679644 posted

    if you use session/cookies and leave the urls the same for all languages you are going to get just 1 page indexed regardless of the language that it's written in. It's important to have different urls for each language so all those pages get indexed


    Thursday, February 11, 2010 4:53 AM
  • User1121634802 posted

    thx for replay


    urlrewriting seems to be a good way but how do you delegate the domain like www.mysite.com/default.aspx to
    www.mysite.com/en/default.aspx
    so that the urlrewrites can start ?

    i imaging the workflow in case of a request to the website like that, isn't it ?

    1. request www.mysite.com/default.aspx

    2. detect language of requester (does this work for search engines also ???)

    3. in case of redirecter language = en, redirect to www.mysite.com/en/default.aspx

    4. rewrite url from www.mysite.com/en/default.aspx to www.mysite.com/default.aspx
    load the en lanuage from the resource file to the default.aspx


    i 'm not sure about all of that, so i hope you or anybody else can bring me some clearness

    thanks a lot


    Thursday, February 11, 2010 9:35 AM
  • User1121634802 posted

    @icecape67

    i know you are right!

    But that's excactly my problem. I know that i need different urls to get indexed the different language-pages.

    If i would start to seperate (and duplicate) my pages in two folders (en and fr), i don't need to use resource files at all.

    And i also won't develop dummypages which one only redirects to the content-page.


    seems to be difficult :)

    thanks for help

    Thursday, February 11, 2010 9:46 AM
  • User-424706843 posted

    Tronix,

    I've started to look into url rewriting recently and I'm still doing testing, so it would be great if someone else with more experience can confirm or not my explanation below.

    Google should show only pages like mysite.com/en/default.aspx mysite.com/fr/default aspx and so on. If someone from outside write in the url bar something like www.mysite.com, you are going (in your code) to redirect him to the proper language path and then he will keep browsing on that path unless he changes the language.

    You are not redirecting people. You are showing outside your website to be www.mydomain.com/en/*** regardless your internal page structure.

    Again, not sure if I'm right, but that's what I understood from all the code example I read out there.


    Thursday, February 11, 2010 10:59 PM
  • User2050679644 posted

    DavideDarko is right.

    You use the url rewritting to expose your pages as distinct urls for each language, then you set the thead language and load only one page with the localized resources.

    You have got a method on the Page class which you can override called InitializeCulture(), that runs before the page load. Suppose your rewritter converts "/articles/es/1414-article-name.html" to "/article.aspx?id=1414&lang=es", you use the InitializeCulture() on the article page to set the executing thread culture to "es" and that will get the content of the "es" resource file


    Friday, February 12, 2010 4:55 AM
  • User1121634802 posted

    thanks


    i got a solution for my problems.

    1. expose my pages with urlrewriting

     from www.mysite.com/fr/default.aspx to www.mysite.com/default.aspx

    2. load css, themes, images when url needs to be rewritten  (http://weblogs.asp.net/fmarguerie/archive/2006/01/11/435022.aspx)


    but at least i want some more :)

    do you know how can i solve the following problem ?

    if someone enters www.mysite.com and the browser language is french, so it should be redirect or rewrite the url to www.mysite.com/fr/default.aspx  ....

    but rewrite www.mysite.com/fr/default.aspx also to the url rewritten path like www.mysite.com/default.aspx

    load the resource depends to the language.


    i want that everbody can see that the url contains /fr/ when he uses a french browser language.

    i hope someone does understand my task


    thanks for any help

    Friday, February 12, 2010 12:14 PM
  • User2050679644 posted

    have you tried checking if the request path is for the "Default.aspx" page the redirecting the use for the browser accept-language of browser?

    Friday, February 12, 2010 5:00 PM
  • User1121634802 posted

    hi icecape67


    i'm not sure if i understand you.

    so could you please tell me again what you mean or may be can you give me an example ?

    thanks a lot again

    Saturday, February 13, 2010 2:54 PM
  • User1121634802 posted

    any ?

    thanks a lot


    Tuesday, February 16, 2010 5:06 AM