A couple of ideas.
1. The apache engine looks for a *file* in the end, so it will try to append /index.html or /index.php (or whatever the setting is for your environment) to a plain url and then rerun the process. That's why I explicitly set the file name if no file is included in the url request, before resetting the directory (see previous notes). ^$, ie no string for the file means that no file request is included in the url, and should trigger a file insertion in your url to preempt url reformatting. After setting a file, I explicitly rerun the process with [R,L] to preserve the original url form. Only after detecting a file do I rewrite the underlying file location.
2. Check your regular expression in a regular expression calculator. Your regular expression returns "barta." (with the period). I fooled around with
http://www.quanetic.com/regex.php for instance, and found that this worked better:
/^(www.)?([^.]*).nl$/ (the leading and trailing "/" is for the expression calculator only, delimiting the regular expression)
or perhaps /^(www.)?([^.]*)/ (without the end of line marker)
With this regex,
http://www.barta.nl yields "www." in field one, and "barta" in field 2. Thus you could do
RewriteCond %{HTTP_HOST} ^(www.)?([^.]*)
RewriteRule ^(.*)$ %2/$1[L]
...if your barta.nl public directory is in barta/
3. Be patient. It took me two *weeks* to get the results that I wanted to cover all the cases.
Good luck, and I hope this helps.
- Henrik