The Translation redirect module, part of the Internationalization (i18n) package, improves search engine optimization (SEO) for multilingual websites. By default, multilingual pages can be accessed via different paths by changing the path prefix or domain. Search engines tend to penalize displaying the same content at more than one URL, so it's important to redirect to a single instance of the page.
The Translation redirect module redirects anonymous users (including web crawlers) to the translation of the page in the requested language, if it exists, using a 301 redirect code. For example, if the request is for
node/23 corresponds to an English page, the user will be redirected to the German translation of the English node if it exists. If the translation does not exist, then the source node content is displayed.
Note that, by design, translation redirection does not work for the homepage or for authenticated users.
Design and Dependencies
The Translation redirect module requires the implementation of
hook_i18n_translate_path by another module for the redirect page to be determined. Currently, the Multilingual content, Path translation, and Taxonomy translation modules implement this hook. The Menu translation module has a "todo" to implement this hook as well.
For node pages, enable the Multilingual content and the Translation redirect modules and the redirection will happen automatically for node pages. No configuration is necessary.
For non-node pages, the redirection
hook must be implemented by the relevant module. For example, for taxonomy pages, you should enable the Taxonomy translation module because the module provides the necessary
hook code. If you are using the Path translation module to create translation sets for non-node pages, then it implements the
hook code for determining the redirection page.