How can I prevent nodes from being accessed via multiple URLs?

Events happening in the community are now at Drupal community events on www.drupal.org.
RichieRich's picture

I believe that the behaviour that I'm currently observing with the Locale module is probably to be expected, but I was wondering if there is a way to get around it in order to ensure that every node is only accessible via a single URL.

Example,

My site consists of Japanese and English (default) pages.

If I specify a node as being Japanese then as you would expect it's no longer accessible via a URL which consists of the path alias but no prefix, such as

/path/alias

It's only available via: ja/path/alias, which is great.

However, I've noticed that the node can also be accessed without the ja prefix via the url: node/nid

Effectively this means that all nodes on the system are accessible via at least two URLs.

This is certainly sub-optimal in terms of SEO. Is there any way that I can force the locale module to ensure that nodes are only accessible via their path alias, including the language prefix, if indeed there is one? Essentially I'd like to get back to the situation that I was in prior to enabling the Locale module where the Global Direct module helped to ensure that all pages were accessible via only a single URL.

Any help greatly appreciated,

Regards, Richard

Comments

Redirection

andy inman's picture

Global Redirect would be the solution if it had a stable multi-language configuration. They are working on it - http://drupal.org/node/201675

You could also try MultiLink - http://drupal.org/project/multilink - with the Redirect sub-module installed. It will redirect node/ paths to the alias equivalent and was designed for multi-language sites (by me :)



Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.

Any solution?

corp82's picture

I'm facing your problem, did you find a solution?

Thank you for your help

Did you try Global Redirect and/or MultiLink?

andy inman's picture

Did you try Global Redirect and/or MultiLink? I'm not sure what the current status is for Global Redirect, but some people have it working I think - see http://drupal.org/node/201675

For my purposes, MultiLink is sufficient. For example, I have a test node/41 with alias this-is-node-41 - this is what happens with MultiLink Redirect installed:

Requested url Result
1 node/41 Redirect to en/this-is-node-41
2 en/node/41 Redirect to en/this-is-node-41
3 this-is-node-41 Redirect to en/this-is-node-41
4 es/node/41 Redirect to en/this-is-node-41
5 es/this-is-node-41 Redirect to en/this-is-node-41

In cases #4 and #5, the redirect to English happens because it is set as my "preferred" language - if this behavior is not required it can be changed with a small patch - see http://drupal.org/node/796822#comment-2988350



Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.

Gave up

RichieRich's picture

I may take a look at what netgenius has posted but I once again decided to go ahead without the Internationalization and Locale modules. I simply found myself pissing into the wind with them all of the time...definitely the weakest points in the wider Drupal network of modules in my opinion, and I suspect that the locale module's implementation is much to blame.

If I ever get the time I'm hoping to write a module which is capable of producing similar results myself, but once again I'm being drawn towards .net coding so I may never get the chance (that's for app coding by the way...Drupal is still the number 1 CMS in my opinion).

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: