Doubleslashes, Apache and cimage

Apache removes double shashes (//) automatically in the path. To fix this:

use THE_REQUEST

RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /images/([^?\ ]+)/?
RewriteRule ^images/ /imgd.php?src=%1 [QSA,NC,L]

Then reference imgd.php with:

http://server/images/https://s3-eu-west-1.amazonaws.com/folder/image.jpg

source