If the script executing is not index.php then do not redirect in front_page_init()

<?php
 
if (!empty($_SERVER['SCRIPT_FILENAME']) &&
strpos($_SERVER['SCRIPT_FILENAME'], 'index.php', strlen($_SERVER['SCRIPT_FILENAME']) - strlen('index.php')) === FALSE) {
    return;
  }
?>

OR

<?php
 
if (!empty($_SERVER['SCRIPT_FILENAME']) && DRUPAL_ROOT . '/index.php' != $_SERVER['SCRIPT_FILENAME']) {
    return;
  }
?>

Both work.

Files: 

Comments

blackclover’s picture

Subscribe
I need this to run cron.php is it going to be a patch?

mikeytown2’s picture

Status:Active» Needs review
StatusFileSize
new382 bytes

Patch attached :)

blackclover’s picture

Thanks you saved me! Worked like a charm. Happy new Year!

mikeytown2’s picture

Status:Needs review» Reviewed & tested by the community
noslokire’s picture

Works for me too!

Simon Georges’s picture

Cross-referencing #1620074: redirect breaks cron & #1470550: Using Front Page with installation profile as the concerned code is the same.

Simon Georges’s picture

Status:Reviewed & tested by the community» Fixed

Committed. Thanks!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.