I'm attempting to use mod_rewrite to remove duplicate slashes from URLs. The following rule works for me in most cases:
RewriteRule ^(.+)//+(.*)$ $1/$2 [L,NC,R=301]
However, it doesn't work on a URL such as the following:
Using RewriteLog, I see the following "init rewrite engine with requested uri /foo". It appears that Apache only passes a single leading slash to the rewrite rules, regardless of how many leading slashes are used in the original URI. Is there some way I can work around this?
I'm running Apache 2.2.9. Any insights greatly appreciated.