I have a multi language site made in Drupal 7. And I want to check if I am on the front page then if true to redirect the user to a to some specific node.
I have tried different methods:
- to create a page
front--page.tpl.php
and then to check language and then redirect I have put this code in
page.tpl.php
:global $language; if ($node->nid == 1) { if ($language->language == "en") { header('Location: en/home'); } elseif ($language->language == "fr") { header('Location: fr/accueil'); } }
I am using i18n module for Drupal 7 so I have tried also to use
$conf['i18n_variables']
insettings.php
like that:$conf['i18n_variables'] = array( 'site_frontpage', 'site_name', );
But I have not succeed to do it. Have you any suggestions ?