Here's a working example:
RewriteRule ^(.*\.tgz)$ tgz.php5?path=$1 [L]
^ = Beginning of the request string
( = Collect stuff starting now
.* = everything
\.tgz = until you find a period followed by tgz. The backslash ensures it is a period, not a wildcard
) = Done collecting
$ = End of request string
tgz.php5 is the new file that will be executed, and the collected stuff will be placed after path=
L = This is the last rewrite rule, don't do any more rewritting
The way it works is that if the file requested is tri.tgz, the request will be rewritten as tgz.php5?path=tri.tgz.
There are a lot of examples up at the Apache site - one way to test this stuff is to use simple scripts that just echo out what they get.
Another example:
RewriteEngine On
# Don't rewrite index.php5
RewriteRule ^index.php5$ - [L]
# Take every request for a .php5 file and pass it to index.php5 as 'page'
RewriteRule ^(.*)\.php5?$ index.php5?page=$1
This is tricky stuff - a certain amount of persistence is required as you're learning.
If you have a blog or other open source product running, you might want to look at their .htaccess file.