This is not a direct answer to your question, here is an alternative to using RewriteRule and .htaccess (Which IMO are more a optimal way to achieve what you want).
Firstly, if at all possible you should favor using your apache server config files over a .htaccess file. There are performance problems as well as potential secuirty problems that arrise from using .htaccess. This is well documented on the internet, so I wont repeat it here, but a quick google search should provide more information.
Secondly, instead of using RewriteRule, a much more scalable solution is to use FallbackResource and a router file.
The idea is if there is ever a request to your site which does not match any of the existing files, the request will be handled by your FallbackResource file.
If in your config (or htaccess) you have
FallbackResource router.php
and someone makes a request for example.com/category/potato
the request will cause the server to serve router.php
(this is assuming category/potato is not actually a file on your server)
So what goes in router.php
? Well you cannot serve every request the same page of course, so you inspect the details of the request that was made and then serve the correct content accordingly.
a very simple (and untested) router:
$request_uri = $_SERVER['REQUEST_URI']; // eg /category/potato
$path_tokens = explode("/", trim($request_uri, "/"));
if($path_tokens[0] == "category"){
$category = $path_tokens[1];
renderCategoryPage($category); // can render the category page for potatoes
}
This example is just to give you an idea, you will have to design and implement your own, but hopefully you can see how this gives more freedom that some britle rewrite rules.