While browsing I found this tool to help write rules for apaches mod-rewrite. I haven’t used it yet, but soon will.

http://www.webmaster-toolkit.com/mod_rewrite-rewriterule-generator.shtml