Put a file called .htaccess in mysite.com/egroupware/ and one in mysite.com/forum/
.htaccess files apply to the directory they are in, and all subdirectories.
So if you had something like this:
Then any rules in mysite.com/.htaccess would apply to all three directories.
Any rules in mysite.com/egroupware/.htaccess would apply to mysite.com/egroupware/ and any sub directories.
Any rules in mysite.com/forum/.htaccess would apply to mysite.com/forum/ and any sub directories.
If you had a rule in mysite.com/.htaccess and a rule in mysite.com/forum/.htaccess conflicted with it, then in mysite.com/forum/ and sub directories, it would use the rule in mysite.com/forum/.htaccess
I hope that makes sense.
#EDIT: You can also make 'directory specific' rules in a .htaccess file.
So in your main .htaccess file, you could have something like this:
php_flag mbstring.func_overload 7
php_flag mbstring.func_overload 0