Details

      Description

      From ooo-dev:

      {quote}
      On Mar 28, 2012, at 2:42 PM, Torokhov Sergey wrote:

      The problem is still here under
      AOO340m1 (Build:9589) Rev. 1303653 22 march 2012

      for "Get more information about OpenOffice.org" doesn't lead to "Native
      Language" internet page

      the link is shown now http://www.openoffice.org/?lang=ru
      but it's doesn't redirect to http://www.openoffice.org/ru/

      The same error there is e.g for the next langpack:

      French, German, Italian etc.
      {quote}

      I think this can be best dealt with by adding additional redirects that convert www.openoffice.org/?lang=en to www.openoffice.org/ and www.openoffice.org/lang=X to www.openoffice.org/X/

      Shall we try it?

      Regards,
      Dave

        Activity

        Hide
        Tony Stevenson added a comment -
        Dave,

        If you want too, we can. You should provide us with the rewrite rules, and make sure they dont overlap/clash with existing objects.
        Show
        Tony Stevenson added a comment - Dave, If you want too, we can. You should provide us with the rewrite rules, and make sure they dont overlap/clash with existing objects.
        Hide
        Gavin added a comment -
        I'll try two for now (say fr and es ?) , but I will need a complete list of languages that you want doing altogether.
        Will let you know progress of those two tomorrow.
        Show
        Gavin added a comment - I'll try two for now (say fr and es ?) , but I will need a complete list of languages that you want doing altogether. Will let you know progress of those two tomorrow.
        Hide
        David Fisher added a comment -
        I think the following is the rewrite rule:

        RewriteRule ^([^/]*)/$ /?lang=$1 [L]

        I think it would be good to review the existing rewrite rules for openoffice.org. I suspect there may be other necessary changes. For example try these:

        http://br.openoffice.org/ ought to go to http://www.openoffice.org/pt-br/

        I might have some cycles this weekend to do a review.
        Show
        David Fisher added a comment - I think the following is the rewrite rule: RewriteRule ^([^/]*)/$ /?lang=$1 [L] I think it would be good to review the existing rewrite rules for openoffice.org. I suspect there may be other necessary changes. For example try these: http://br.openoffice.org/ ought to go to http://www.openoffice.org/pt-br/ I might have some cycles this weekend to do a review.
        Hide
        David Fisher added a comment -
        In the past http://openoffice.org was excluded from rewrite rules. This has gone away. So, in this issue these are openoffice.org rewrite rules. If nothing matches then rewrite as www.openoffice.org.

        The rewrite rule should be this:

        RewriteRule http://www.openoffice.org/^([^/]*)/$ /?lang=$1 [L]

        Show
        David Fisher added a comment - In the past http://openoffice.org was excluded from rewrite rules. This has gone away. So, in this issue these are openoffice.org rewrite rules. If nothing matches then rewrite as www.openoffice.org . The rewrite rule should be this: RewriteRule http://www.openoffice.org/ ^([^/]*)/$ /?lang=$1 [L]
        Hide
        David Fisher added a comment -
        Further refinement.

        We need this ?lang= redirect on both openoffice.org and www.openoffice.org domain names.

        Is it time to treat www.openoffice.org and openoffice.org as the same domain?

        Regards,
        Dave
        Show
        David Fisher added a comment - Further refinement. We need this ?lang= redirect on both openoffice.org and www.openoffice.org domain names. Is it time to treat www.openoffice.org and openoffice.org as the same domain? Regards, Dave
        Hide
        Andrea Pescetti added a comment -
        Shouldn't the rewrite be the other way round?

        Our source is like http://www.openoffice.org/?lang=it and out target is like http://www.openoffice.org/it

        (there's probably no need to mix this with the www.openoffice.org vs openoffice.org issue, since this is a hardcoded link in the OpenOffice binaries and it always uses www.openoffice.org)
        Show
        Andrea Pescetti added a comment - Shouldn't the rewrite be the other way round? Our source is like http://www.openoffice.org/?lang=it and out target is like http://www.openoffice.org/it (there's probably no need to mix this with the www.openoffice.org vs openoffice.org issue, since this is a hardcoded link in the OpenOffice binaries and it always uses www.openoffice.org)
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> I don't see a consensus here. What do you want redirected where? Answers in RewriteRule format preferred :)
        Show
        #asfinfra IRC Bot added a comment - <danielsh> I don't see a consensus here. What do you want redirected where? Answers in RewriteRule format preferred :)
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> remind feedback timeout
        Show
        #asfinfra IRC Bot added a comment - <danielsh> remind feedback timeout
        Hide
        Andrea Pescetti added a comment -
        In plain English, what we want is that
        http://www.openoffice.org/?lang=it
        is redirected to
        http://www.openoffice.org/it

        and in general that
        http://www.openoffice.org/?lang=LG
        is redirected to
        http://www.openoffice.org/LG

        for LG=(.*) or at least it, en, de, es... but since the parameter is used only by the OpenOffice program (not by website URLs) the redirection could be made general.

        In mod_rewrite language, something like:

        RewriteCond %{QUERY_STRING} lang=it
        RewriteRule ^(.*)$ /it/index.html? [L]

        works for me (the ? in the second line is meant to kill the query string as per http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond section "Modifying the Query String").
        Show
        Andrea Pescetti added a comment - In plain English, what we want is that http://www.openoffice.org/?lang=it is redirected to http://www.openoffice.org/it and in general that http://www.openoffice.org/?lang=LG is redirected to http://www.openoffice.org/LG for LG=(.*) or at least it, en, de, es... but since the parameter is used only by the OpenOffice program (not by website URLs) the redirection could be made general. In mod_rewrite language, something like: RewriteCond %{QUERY_STRING} lang=it RewriteRule ^(.*)$ /it/index.html? [L] works for me (the ? in the second line is meant to kill the query string as per http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond section "Modifying the Query String").
        Hide
        Daniel Gruno added a comment -
        Do you want a redirect or a rewrite?

        If you want to _redirect_ /?lang=foo to /foo, then something like this is what you need:

        RewriteCond %{QUERY_STRING} lang=([a-zA-Z]+)
        RewriteRule ^(.*)$ /%1/$1? [R]

        This would redirect /?lang=foo to /foo/, as well as /bar?lang=foo to /foo/bar.
        If you just want /bar?lang=foo to always redirect to /foo (and discard /bar), then you'll need this instead:

        RewriteCond %{QUERY_STRING} lang=([a-zA-Z]+)
        RewriteRule .* /%1? [R]
        Show
        Daniel Gruno added a comment - Do you want a redirect or a rewrite? If you want to _redirect_ /?lang=foo to /foo, then something like this is what you need: RewriteCond %{QUERY_STRING} lang=([a-zA-Z]+) RewriteRule ^(.*)$ /%1/$1? [R] This would redirect /?lang=foo to /foo/, as well as /bar?lang=foo to /foo/bar. If you just want /bar?lang=foo to always redirect to /foo (and discard /bar), then you'll need this instead: RewriteCond %{QUERY_STRING} lang=([a-zA-Z]+) RewriteRule .* /%1? [R]
        Hide
        Andrea Pescetti added a comment -
        The latter will be enough for this project's needs. This is just to circumvent some hardcoded URLs in the suite, and the target should always be www.openoffice.org/it or similar, not subpages.
        Show
        Andrea Pescetti added a comment - The latter will be enough for this project's needs. This is just to circumvent some hardcoded URLs in the suite, and the target should always be www.openoffice.org/it or similar, not subpages.
        Hide
        David Fisher added a comment - - edited
        Here is the patch:


        --- httpd-conf/www.apache.org/vhosts/zzzothers.conf (revision 828411)
        +++ httpd-conf/www.apache.org/vhosts/zzzothers.conf (working copy)
        @@ -227,6 +227,11 @@
            RewriteRule ^(.*)$ ${lowercase:%{HTTP_HOST}}$1 [C]
            RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) http://www.openoffice.org/$1/$2 [NE,L,R=permanent]
         
        + # change *.openoffice.org/?lang=foo to www.openoffice.org/foo/
        + RewriteCond ${lowercase:%{QUERY_STRING}} lang=([a-z\-]+)
        + RewriteCond /x1/www/ooo-site.apache.org/content/%1 -d
        + RewriteRule .* http://www.openoffice.org/%1 [NE,L,R=permanent]
        +
            # fallback for proj.openoffice.org/... to openoffice.org/projects/proj/...
            RewriteCond ${lowercase:%{HTTP_HOST}} ^(?!www)(\w+)(?:\.\w+)?\.openoffice\.org$
            RewriteRule ^(.*)$ ${lowercase:%{HTTP_HOST}}$1 [C]
        Show
        David Fisher added a comment - - edited Here is the patch: --- httpd-conf/ www.apache.org/vhosts/zzzothers.conf (revision 828411) +++ httpd-conf/ www.apache.org/vhosts/zzzothers.conf (working copy) @@ -227,6 +227,11 @@     RewriteRule ^(.*)$ ${lowercase:%{HTTP_HOST}}$1 [C]     RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) http://www.openoffice.org/$1/$2 [NE,L,R=permanent]   + # change *.openoffice.org/?lang=foo to www.openoffice.org/foo/ + RewriteCond ${lowercase:%{QUERY_STRING}} lang=([a-z\-]+) + RewriteCond /x1/www/ooo-site.apache.org/content/%1 -d + RewriteRule .* http://www.openoffice.org/%1 [NE,L,R=permanent] +     # fallback for proj.openoffice.org/... to openoffice.org/projects/proj/...     RewriteCond ${lowercase:%{HTTP_HOST}} ^(?!www)(\w+)(?:\.\w+)?\.openoffice\.org$     RewriteRule ^(.*)$ ${lowercase:%{HTTP_HOST}}$1 [C]
        Hide
        Gavin added a comment -
        All Done.

        See r828963
        Show
        Gavin added a comment - All Done. See r828963

          People

          • Assignee:
            Unassigned
            Reporter:
            David Fisher
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development