My site, parsing image from another site, but don't show them. (It shows: ����������������� )
I know what it is, it is a problem with Content-Type
.
I need to use Content-Type: image/jpeg
, and all will be ok!
But images are opened by URL (eg. example.com/DIR1/(100000-999999)/DIR2/(100000-999999)/
). This number is random.
If I write in .htaccess
(on example.com
) the following then it works:
Header set Content-Type: image/jpeg
- i see photo .
But then all other URLs fail!
How can I : If DIR1/(.*)/DIR2/(.*)/
- Use Content-type: image/jpeg
?
DIR1 , DIR2 = Photos/(number)/image/(number)
Your script that serves the image should really be generating this header as part of the response.
However, to set this conditionally in
.htaccess
just for this form of URL-path then you could do something like this: