Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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!