Configuration: Running drupal in a subdirectory, e.g. http://server/drupal/
RewriteBase set in .htaccess to /drupal/

Symptoms: After installing MultiLink, the links in a language switcher block are updated from e.g. http://server/drupal/?language=fr to http://server/drupal/?language=fr&multilink=switch. This is as expected. However, when clicking on one of these links, MultiLink hooks into the request and redirects to http://server/?language=fr (instead of http://server/drupal/?language=fr, as expected).

Causes: This seems to be caused by line 434:
$request = '/' . request_path();
If one changes this line to $request = ini_get('RewriteBase'). request_path();, the problem seems to be solved

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Andy Inman’s picture

Thanks for the report. Your solution looks good too. I'll put it into the next release.

See also #1466630: Redirect does not work if Site is running in subdirectory which probably needs something similar.

corfiot’s picture

Issue tags: +nginx

ini_get('RewriteBase') will only work in apache/.htaccess environments. If this value is not set in .htaccess and/or the server is not Apache you will get a blank string. This will cause node translations to fail.

In an nginx environment I had better luck with: $request = base_path(). request_path();

rterrein’s picture

Patch (second solution)

bitshiftcop’s picture

Issue summary: View changes

Had the same issue today.
Tried the latest version (2.9) and latest dev version.
Still not fixed.

Then tried this patch, works!

Andy Inman’s picture

Thanks for that. I need to push out a new version soon, due to #2259441: Generic HTML links - only last occurence on line is replaced so will build in rterrein's #3 patch too. So, expect to see 2.10 out in a few days.

Andy Inman’s picture

Added to latest release. Closing this.

Andy Inman’s picture

Status: Needs review » Closed (fixed)