By the usual yawn-provoking coincidence, only yesterday I discovered that the reason the googlebot periodically asks for /directory//blahblah/ is that-- wait for it-- in one place, on one page, I had a coding error that led to a link to /directory// instead of the intended /directory/subdir/ (that is, "subdir" was undefined). I only discovered it when several consecutive
human visitors requested the same page, all from the same rarely-visited referring page. Ahem. Cough-cough. I've been redirecting for a good year before I figured out why this was going on; in fact it's a mystery why only Google was doing it. (Could it be that all other search engines are simply more intelligent, and
know that multiple slashes have to be a mistake?)
You are right about one thing: The RewriteRule itself will not recognize // in the path. (No idea why. I just know from direct personal experience that it doesn't.) You have to put it in a RewriteCond. But the rule itself isn't optimal.
I would write the rule like this:
RewriteCond %{REQUEST_URI} ^/forum//+(.*)
RewriteRule . http://www.example.com/forum/%1 [R=301,L]
No point in capturing something that will always be the same. And always give the full protocol-plus-domain in the target to avoid the possibility of multiple redirects.
:: edit, edit, edit ::
I'm puzzled about the <Directory /forum/> part, though. This implies you're working in the config file-- but is the forum by itself in a top-level directory? Is it a subdomain? In most situations, you could achieve the same end more cleanly by expressing the pattern as
^forum/
et cetera, putting the rule in the same place as the RewriteRules for the rest of the site.