Mod_Rewrite SEO Friendly URLs

Hi,

I’m having trouble making:

domainname.com/forum/topic.php?tid=1&n=1

rewrite to:

domainname.com/forum/1/1/

I have some possible variables to append such as if its the last post &lp=1

Here is what I thought would work:
RewriteRule ^forum/([A-Za-z0-9]+)/([A-Za-z0-9-]+)/?$ forum/topic.php?tid=$1&n=$2

[QSA,L]

I think it is the directory messing it up as I can create rewrites when I do not have them going outside the root.

Thanks for any assistance!

brit,

I was concerned with your “rewrite to” wording but did see that you meant rewrite FROM (the unservable to the format Apache can serve).

While I abhore the use of an optional trailing / (it upsets the directory level that Apache is serving relative links from), your mod_rewrite appears fine with the exception of keeping the flags on the same line (separated from the redirection by a single space).

Regards,

DK