I haven't done this for a while. I hope my syntax is correct. There are a few different ways you could do this. You can make a separate .htaccess file in each directory. If you had a global .htaccess file this is how it would look:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^/(.*)/(.*)/(.*).html$ /$1/$2.php?var1=$3 [L]
</IfModule>
Hope that helps.