I would like to proxy images calls from external domains, for example that url:
https://example.com/proxy/http://externaldomain.com/image.jpg
Would respond the image (not a redirection).
I would like to proxy images calls from external domains, for example that url:
https://example.com/proxy/http://externaldomain.com/image.jpg
Would respond the image (not a redirection).
Try this rule for .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.jpg -f [OR]
RewriteCond %{REQUEST_FILENAME}.png -f
RewriteRule ^(.*)$ http://external.com/$1 [P]
OR
In httpd.conf
:
ProxyPreserveHost off
ProxyPassMatch ^/(.*\.(jpg|png))$ http://external.com/$1
Although I didn't checked both of the rules for now but please ensure that these two lines are uncommented in httpd.conf
.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so