.htaccess - Apache rewrite engine for image proxying -


requests "/logos/(prefix + md5 hash)" (prefix first char)
example /logos/012330293949292332

the htaccess config should following:

  • split (prefix + md5 hash) prefix , md5 hash
  • return logo if md5 hash.png in folder /logos/default
  • return logo if prefix.* in folder /logos/custom/hash
  • my current solution works php image proxy not fast enough possible apache rewrite engine , if yes, how?

    solution:

    rewritecond %{document_root}/images/logos/default/$2.png -f rewriterule ^logos/(.)(.+)$     /images/logos/default/$2.png [nc,l]  rewritecond %{document_root}/images/logos/custom/$2/$1.png -f rewriterule ^logos/(.)(.+)$     /images/logos/custom/$2/$1.png [nc,l]