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
Comment | File | Size | Author |
---|---|---|---|
#3 | 1543876_MultiLink_breaks_language_switcher_links_if_drupal_is_running_in_a_subdirectory.patch | 587 bytes | rterrein |
Comments
Comment #1
Andy Inman CreditAttribution: Andy Inman commentedThanks 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.
Comment #2
corfiot CreditAttribution: corfiot commentedini_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();
Comment #3
rterrein CreditAttribution: rterrein commentedPatch (second solution)
Comment #4
bitshiftcop CreditAttribution: bitshiftcop commentedHad the same issue today.
Tried the latest version (2.9) and latest dev version.
Still not fixed.
Then tried this patch, works!
Comment #5
Andy Inman CreditAttribution: Andy Inman commentedThanks 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.
Comment #6
Andy Inman CreditAttribution: Andy Inman at netgenius.co.uk commentedAdded to latest release. Closing this.
Comment #7
Andy Inman CreditAttribution: Andy Inman at netgenius.co.uk commented