Q:

htaccess rule is passing innecesary variable

This is the file tree:

/problem/
/problem/index.php
index.php
category.php
somefile.php

I have this 2 rules in the .htaccess that is sitting in the /
RewriteRule ^somedir$ /somefile.php [L]
RewriteRule ^([a-z-]+)$ /category.php?cat=$1 [QSA,L]

So...

http://domain.com/somedir = OK
http://domain.com/ = OK
http://domain.com/problem/ < automatically adds ? cat=problem to the querystring.  I want to avoid that extra ? cat=problem

I need to add a rule that doesn't add the cat=$1 when the /dir/ exists. 

A:

Just add a RewriteCond before your second rule.  Basically, don't run that catch all if it starts with product:
RewriteRule ^somedir$ /somefile.php [L]
RewriteCond %{REQUEST_URI} ! ^/product [NC]
RewriteRule ^([a-z-]+)$ /category.php?cat=$1 [QSA,L]

To prevent redirecting for a real file or directory, add these two lines before the rule:
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} ! -d

