Last try to fix broken, rewritten links
authorRoland Häder <roland@mxchange.org>
Sat, 14 Mar 2009 19:31:07 +0000 (19:31 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 14 Mar 2009 19:31:07 +0000 (19:31 +0000)
inc/libs/rewrite_functions.php

index 197a46a..236b440 100644 (file)
@@ -51,12 +51,18 @@ function REWRITE_LINKS ($HTML) {
        $target = "{!URL!}/cms/";
 
        // Convert modules.php?module=...
-       $output = str_replace("/" . "{!URL!}/modules.php?module=", $target, $HTML);
+       $output = str_replace(constant('URL') . "/modules.php?module=", $target, $HTML);
+
+       // Convert modules.php?module=...
+       $output = str_replace("{!URL!}/modules.php?module=", $target, $output);
 
        // Do we have an URL linked to mxchange.org?
        if (eregi(constant('SERVER_URL'), $output)) {
                // Convert URLs from my server
-               $output = str_replace("/" . "{!URL!}/modules.php?module=", constant('SERVER_URL')."/cms/", $output);
+               $output = str_replace("{!URL!}/modules.php?module=", constant('SERVER_URL')."/cms/", $output);
+
+               // Convert URLs from my server
+               $output = str_replace(constant('URL') . "/modules.php?module=", constant('SERVER_URL')."/cms/", $output);
        } // END - if
 
        // Strip slashes as above for the main URL