If I browse to http://www.example.com/userA/index.php I get a 404, it doesn't redirect to /mc/userA/index.php
That seems reasonable, since you don't
want your users accessing pages by multiple different routes. In fact you should have an "index.php" redirect somewhere further along-- or rather, earlier in .htaccess, since you're talking about internal rewrites. But read on.
If the address bar is changing, you're doing one or both of two things wrong: either the RewriteRule itself has an [R] flag, or the target of the rewrite begins in http://www.example.com. The rule itself should only say
RewriteRule ^(\w+)$ /mc/$1/index.php [L]
with whatever Conditions you decide are appropriate. Note that since this is an internal rewrite rather than an external redirect, it is correct and appropriate to say explicitly "index.php" at the end. In an external redirect you will never show this part.
I now realize I misread your original post: the "real" URL is not
/mc/jdoe.html
but rather
/mc/jdoe/index.php
Oops.
All this is assuming you've got a hand-rolled site, possibly with your own rewriting. If it's a CMS doing things on its own initiative, we will need to hammer out some details.
NO files exist at example.com/jdoe/index.php
Right. But also no files exist at example.com/jdoe -- and right now, you're permitting two ways to view the same content:
example.com/jdoe
example.com/mc/jdoe/index.php
If you don't want this, you'll need an external redirect
earlier in your htaccess, looking like this
RewriteCond %{THE_REQUEST} /mc/
RewriteRule ^mc/(\w+)(/(index.php)?)?$ http://www.example.com/$1 [R=301,L,NS]
That's if you want to allow for all possible requests:
example.com/mc/jdoe
example.com/mc/jdoe/
example.com/mc/jdoe/index.php
This is with the further assumption that you've got a DirectoryIndex line elsewhere, naming "index.php".
The overall order of these RewriteRules should be:
--
Redirect any request in /mc/name/index.php to preferred URL in form /name alone (rule has [R] flag)
--
Redirect any other requests for "index.php" to whatever the directory is (again with [R] flag)
--
Rewrite requests for /blahblah to /mc/blahblah/index.php (rule ends in [L] flag only)