Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If the script executing is not index.php then do not redirect in front_page_init()
if (!empty($_SERVER['SCRIPT_FILENAME']) &&
strpos($_SERVER['SCRIPT_FILENAME'], 'index.php', strlen($_SERVER['SCRIPT_FILENAME']) - strlen('index.php')) === FALSE) {
return;
}
OR
if (!empty($_SERVER['SCRIPT_FILENAME']) && DRUPAL_ROOT . '/index.php' != $_SERVER['SCRIPT_FILENAME']) {
return;
}
Both work.
Comment | File | Size | Author |
---|---|---|---|
#2 | front-ignore-non-index-requests-1371120-2.patch | 382 bytes | mikeytown2 |
Comments
Comment #1
blackclover CreditAttribution: blackclover commentedSubscribe
I need this to run cron.php is it going to be a patch?
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedPatch attached :)
Comment #3
blackclover CreditAttribution: blackclover commentedThanks you saved me! Worked like a charm. Happy new Year!
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedComment #5
noslokire CreditAttribution: noslokire commentedWorks for me too!
Comment #6
Simon Georges CreditAttribution: Simon Georges commentedCross-referencing #1620074: redirect breaks cron & #1470550: Using Front Page with installation profile as the concerned code is the same.
Comment #7
Simon Georges CreditAttribution: Simon Georges commentedCommitted. Thanks!