I've web software where I have to have Web addresses such as this

http://site.com/page/var1/val1/var2//var3/val3

I Quickly catch such Web addresses inshtaccess, redirect to some php file which in turn parses that to $_GET and forwards everything to primary application. That double-slash is essential, this means that var2 continues to be set and consists of a clear value, quite simply $var2!==NULL.

On some servers it really works not surprisingly but on some servers it does not, the URL is quietly transformed into

http://site.com/page/var1/val1/var2/var3/val3

which obviously breaks everything since it parses it to $var1='val1', $var2='var3', $val3=''.

Regrettably I already don't get access to among individuals servers and that i don't remember 100% whether or not this was Apache or otherwise but let us assume it had been Apache since this is the server we cope with more often than not.

Can there be might be some config that controls that? That activates/from the cleaning of double-slashes.

Apache strips such empty path segments before mapping it to the file system. To obtain the original asked for URI in mod_rewrite, look into the request line in %{THE_REQUEST}:

RewriteCond %{THE_REQUEST} ^GET\ (/[^?\ ]*)
RewriteRule …

After that you can reference the match of RewriteCond with %1.