Experimental project

This is a sandbox project, which contains experimental code for developer use only.

The front page redirect module redirects visitors that arrive on the front page of your site to the page that is defined as the default front page.

Introduction

Drupal allows you to define what content to serve on the home page. However, Drupal does not redirect visitors to that page but instead just serves the content of that page on the front page.

This might lead to some problems:

To alleviate these problems, this module really redirects visitors that arrive at the front page to the page that is defined as front page. It does so using a 301 (Moved Permanently) status code.

Targeted use

This module is typically targeted at:

  • multilingual sites
  • that have a different homepage per language (i18n_variable module from i18n)
  • and use the browser settings to detect the language (locale module from core).

Configuration and usage

There is no separate configuration for this module. This modules uses the configuration as set in field "Default front page" on the "Site information" page (admin/config/system/site-information).

If you want a different front page per language, install the i18n project (http://drupal.org/project/i18n) and enable the "Variable translation" (i18n_variable) sub module. On the "Multilingual settings variables" page (admin/config/regional/i18n/variable) you have to check the "Default front page" checkbox and save your settings.

Then go back to the "Site information" page and you will see that there is a fieldset at the top of the page telling you "There are multilingual variables in this form." Select the language you want to define the front page for and fill it in the "Default front page" field.

Note: possible clash with Global Redirect

If you also have installed the global redirect module, then ensure that you uncheck the option "Frontpage Redirect Handler" as that option does the exact opposite of this module and thus will lead to an infinite redirect loop.

Future

This module is only a few lines of code and I would love to integrate it into an existing module. I didn't find them, that is why I wrote this module. I will introduce this module to the maintainers of i18n_redirect, redirect and front_page modules. I will do so by posting a request in the issue queue to see if they are interested in this feature. If you know of other module that does (more or less) the same (or more), please let me know. Until that time I will fully support this module.

Project Information