Can you show us how you modified your .htacccess file after reading the above page? I couldn't think of what to do myself until I read that site. What they do is first rewrite all spaces to "%20", and then you use a rule like you have to do the actual URL rewrite.
In other words, you're modifying the URL twice - once to check for spaces (and safely encode them if found), and a second time to redirect the URL to your file.php script.