Hehehe, am I stupid or what?!?!
Since I was only simply trying to convert from
/one/two/three
to
/index.php?q=one/two/three
I should've thought of a simple concatenation in the first place!
From above, simply replacing
$new_uri = eregi_replace($key, str_replace("$", "\\", $value), $uri);
with
$new_uri = "/index.php?q=".$uri;
does the trick for this purpose. What was I thinking? How stupid was I then? Is there a rule here against flaming one's own self? Aaaarrggghhh!!!
Hindsight sure is 20/20. I can't believe these things still happen to me, it's so frustrating. *sigh*
Update: Clean URL Support in Abyss (for Drupal)
http://drupal.org/node/66114