Apacheの設定
下記、最短マッチに対応
<Directory /var/www/public>
<IfModule sed_module>
AddOutputFilter Sed html php
OutputSed "s/\"\/\([^\"]*png\)\"/\"http\:\/\/test\.cloudfront\.net\/\1\"/g"
OutputSed "s/\"\/\([^\"]*jpg\)\"/\"http\:\/\/test\.cloudfront\.net\/\1\"/g"
OutputSed "s/\"\/\([^\"]*jpeg\)\"/\"http\:\/\/test\.cloudfront\.net\/\1\"/g"
OutputSed "s/\"\/\([^\"]*gif\)\"/\"http\:\/\/test\.cloudfront\.net\/\1\"/g"
</IfModule>
</Directory>