mod_rewrite is a very powerful mod, sometimes too powerful... 🙂
If you don't have access to Apache config and what not, another possiblity would be to do a little playing around with server vars.
For example, this link:
code.php/this/is/a/test
Would return the following in the $_SERVER[ 'PATH_INFO' ] variable:
/this/is/a/test
So, if you know that the URL will always be in the same format, you could do something like:
$forum = split('/', $_SERVER[ 'PATH_INFO' ]);
With the above URL, that would give you an array like:
Array
(
[1] => this
[2] => is
[3] => a
[4] => test
}
Then you could use that array to pull the topic/etc.
Hope that helps!
-Percy