Needs redirect for cross language
binhcan - April 3, 2009 - 13:23
| Project: | Global Redirect |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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
| Attachment | Size |
|---|---|
| In-redirected-URL.png | 13.52 KB |

#1
That 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 !
#2
I 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.
#3
To be clear, going to node/x doesn't redirect, but going to nl/node/x does. It should do so in both cases.
#4
We 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
#5
Subscribing
#6
susbscribing
#7
really no solution for that essential problem yet? can't believe.
#8
Subscribe.. But the temporary solution:
Here is the "Domain name only" language selection version from halfgaar's solution (#4)
<?php
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
$result = db_query("SELECT * FROM {url_alias} WHERE src = 'node/%d' LIMIT 1", $_GET['nid']);
if ( db_error() ) die("O agony!");
$url_alias_object = db_fetch_object($result);
$destination = $url_alias_object->dst;
$result = db_query("SELECT domain FROM {languages} WHERE language = '%s'", $url_alias_object->language);
if ( db_error() ) die("O agony!");
$domain = db_result($result);
header("Location: $domain/$destination",TRUE,301);
?>
(And of course You need the .htaccess modification from here:
http://blog.bigsmoke.us/2009/06/10/enforcing-drupal-url-aliases)