2010
01.28

It might be very convenient to create a page with PHP-filter and then insert a drupal_goto function to divert the user according to the conditions (e.g. logged-in, role ).

However, you should be careful not to break Cron with drupal_goto. As cron will get stuck trying to index your page with drupal_goto function.

In order to prevent this you can check for the $_SERVER['SCRIPT_NAME']. For example:

if ($_SERVER['SCRIPT_NAME'] != '/cron.php') {
       drupal_goto('someplace/in/your/website');
     }
  1. Thank you for posting this elegant solution to an annoying drupal problem.