If I have an installation in a subdirectory, then the subdirectory gets added on twice when the URL is rewritten. So, a URL like "/subdir/node/1" would get rewritten to be "http://example.com/subdir/subdir/node/1".
I think the $base_path needs to searched for, instead of "/", and the following code should do it:
global $base_path;
$text = preg_replace(
'/(src|href)=(\'|")' . preg_quote($base_path, '/') . '/',
'$1=$2'. url('<front>', array('absolute' => TRUE, 'language' => $lang)),
$text
);
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | sub-directory-installations-1335734-2.patch | 513 bytes | joelstein |
Comments
Comment #1
oskar_calvo commented@joelstein
I have the same problem, and your code solved it.
You should make a patch to the module.
Oskar
Comment #2
joelstein commentedHere's the patch.
Comment #3
podarokThanx!
Fixed!
http://drupal.org/node/1719802
http://drupal.org/node/1719804