we've discussed many times that we're both on shared hosting
Yes, we have. I have no idea why, but I tend to answer posts without looking at who asked the question except for a quick glance to see if they're a brand spankin newbie ("posts: 1").
Mea culpa.
I suspect that multiple leading contiguous slashes are suppressed before the requested URI is stored in the REQUEST_URI server variable. You might need to test THE_REQUEST instead.
fwiw: I just recently had a request that arrived with leading double-slash (probably cut & paste from a human). All related image requests came with the same double slash, and were processed without complaint.
:: detour for quick test on, ahem, my own shared hosting ::
Interesting. I did this:
RewriteCond %{HTTP_USER_AGENT} Camino
RewriteCond %{REQUEST_URI} ^(.+)r
RewriteRule foobar http://www.example.com/%1 [R=301,L]
Of course I would never do this in a "real" Rewrite ;) The non-captured r is to ::cough-cough:: prevent an infinite Redirect (caught by the browser, not the server).
If I request
www.example.com/foobar.html
I get redirected to
www.example.com//fooba
If I request
www.example.com//directory//foobar.html
I get redirected to
www.example.com///directory//fooba
and so on. In other words, the leading slash in the REQUEST_URI is captured and added to the redirect. If you start with a bunch of slashes, the output will have one more.
But wait! If I change one tiny thing in the Rule, eliminating the slash so it says only
RewriteRule foobar http://www.example.com%1 [R=301,L]
everything changes.
Now, if I request
www.example.com/foobar.html
I get redirected to
www.example.com/fooba
as you would expect based on the previous version.
But if I request
www.example.com///foobar.html
I still get redirected to
www.example.com/fooba
And if I request
www.example.com//directory//foobar.html
--again, with any number of leading slashes--
I get redirected to
www.example.com/directory//fooba
Huh what?