Hi dev team,
I realised that my Chinese Furniture site has a lot of duplicated content for translated pages.
I use 2 domains one for English and one for Chinese. I have no idea how Google could be too quick to index the site that the Chinese nodes was indexed as jyfurn.com/node/x where x is the node id. I was so confident that Global Redirect would do the job of redirecting the "/node/x" to the porper clean url, but after testing I realize it doesn't.
I beleive other people are facing the same problem for multilingual site too, just they haven't realized yet.
Attached is the Google index of my English site.
So please help us. Thanks very much.
Regards
Binh
Comments
Comment #1
woot commentedThat right ! Just realized that google is indexing this pages :(
Would be nice if there is a up-comming patch for this issue.. anyway great module !
Comment #2
halfgaar commentedI have it too, with a site in English and Dutch. English pages are available as http://domain/pagename. Dutch pages as http://domain/nl/pagename. If you go the node number of a Dutch page, you are not redirected properly.
I changed this to a bug report, because a feature makes it sound optional.
Comment #3
halfgaar commentedTo be clear, going to node/x doesn't redirect, but going to nl/node/x does. It should do so in both cases.
Comment #4
halfgaar commentedWe ended up deleting the global redirect module and fixed it by using 22 lines of PHP and one line of .htaccess. It's faster and more robust.
See: http://blog.bigsmoke.us/2009/06/10/enforcing-drupal-url-aliases
Comment #5
AdrianB commentedSubscribing
Comment #6
mani.atico commentedsusbscribing
Comment #7
fhelmschrott commentedreally no solution for that essential problem yet? can't believe.
Comment #8
kepesv commentedSubscribe.. But the temporary solution:
Here is the "Domain name only" language selection version from halfgaar's solution (#4)
(And of course You need the .htaccess modification from here:
http://blog.bigsmoke.us/2009/06/10/enforcing-drupal-url-aliases)
Comment #9
2xe commentedSuggestion for path prefix only... Attached patch is a regular diff against the current release version.
Comment #10
2xe commentedfixed a bug.
Comment #11
2xe commentedAnother bugfix; don't change prefix unless the language is enabled...
Edit:
For multilingual sites using path prefixes requests to any language but the default language did not get redirected to the aliased URL. I have been using this patch for a few days now, and it seems to work fine.
Comment #12
boobaaSubscribing.
Comment #13
okokokok commentedThis i18n issue has been bothering me for a long time now. Happy to see some work has been done already towards fixing this.
SeroSero, I had to reverse apply your patch:
I only took a quick look but it doesn't seem to work as intended on the one site I tried it on.
Comment #14
okokokok commentedI'm having more luck with
preg_match("@^node/(\d*)$@", $path, $regs)\d instead of /d and $path instead of $request.I also added
$options['language']->language = $language_code;to theif ($languages[$language_code]->enabled)condition.Now something is working, except that node/7144 goes to the English version of the node, whereas it should go to the Arabic. It's probably because the $prefix is simply dropped. And I'm getting redirect loops for arabic/node/7144 and arabic/node/8003 (the English translation). To be continued...
Comment #15
okokokok commentedI tried refactoring out this part into a separate function. Now it's kinda working but it breaks other parts (issue with trailing slash, and infinite 301 loops for english/node/123).
I'm going to spend some time on refactoring code into functions to make this problem easier to tackle.
Comment #16
okokokok commentedI fixed the issue with the trailing slash by separating the $redirect_slash case.
I also moved more into a helper function to clear things up a bit (at least in my head :)
This needs a review now.
But beware, I have surely overlooked things and this patch will definitely break your production site!
I'm going to try to tackle the redirect across domains now.
Comment #17
okokokok commentedOne minor issue: arabic/node/8003 is an English language node but not redirected to the English language.
And here's the fix:
Comment #18
okokokok commentedOk, just finding out that this issue is _another_ duplicate of http://drupal.org/node/201675
Comment #19
okokokok commentedI'm marking this as a duplicate of #201675: Redirect to version in native language. Correct me if I'm wrong,