During testing I hit this problem.
My site was running on: http://drupal.local/site6 and the redirect did not work.
It turned out that this check:
&& $_SERVER['SCRIPT_NAME'] == '/index.php' &&
caused the problems, because actually the $_SERVER['SCRIPT_NAME'] contains: "site6/index.php"
Is this check really necessary?

Comments

Andy Inman’s picture

Category: task » bug

Thanks for the report. That check is not necessary in most installations, you can probably just remove it - under normal circumstances the current script will be index.php. Changing that test to the following should allow it to work as intended:

  ... $_SERVER['SCRIPT_NAME'] == $GLOBALS['base_path'] . 'index.php') ...

I'm setting status here to bug report.

Andy Inman’s picture

  • 155a871 committed on 7.x-2.x
    Added support for Drupal running in a subdirectory. Addresses #1466630
    
Andy Inman’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)