Mod_Rewrite SEO Friendly URLs


I’m having trouble making:

rewrite to:

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


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!


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).