Forum Moderators: phranque
I have an HTML page sitting on Server A (www.yyy.com):
[yyy.com...]
Within this page are img src references www.yyy.com/Image_library/Website_images/.....
(however, the images are actually located on another image server (apimg1) which actually does not have a public IP address and hence not accessible from the Internet. It has only internal IP address. Server A (has public IP address) and APIMG1 (no public IP address) are on the same LAN.
Hence, I had to do a rewrite to map all image src requests to the image server (apimg1).
RewriteCond %{HTTP_HOST} ^www\.yyy\.com [NC]
RewriteRule /Image_Library/Website_images/([^.]+)\.(gif¦jpg¦png)$ [apimg1...] [R=301,L]
However, the images still do not load. I check the Rewrite Log and notice that the URL www.yyy.com is not even detected (ie the RewriteCond is not happening). Is HTTP_HOST the correct variable to use or is it something else? My img src tags are all using the full url, ie. [yyy.com...] not relative paths (as the images are located in a separate image server)
thanks a lot
See the RewriteRule documentation for a description of the [P] flag, and refer to Apache mod_proxy for more details.
Jim
I changed the RewriteRule to :
RewriteCond %{HTTP_HOST} ^www\.#*$!\.com [NC]
RewriteRule /Image_Library/Website_images/([^.]+)\.(gif¦jpg¦png)$ [apimg1...] [P]
the img src tags in the html page would look like this :
[xxx.com...]
but the logs are still not showing that these img srcs tags are processed at all. I even tried to use ProxyPass directives but that don't seem to work either.
ProxyRequests Off
<ProxyMatch /Image_Library/Website_images/([^.]+)\.(gif¦jpg¦png)$>
Order deny,allow
Allow from all
</ProxyMatch>
ProxyPass /Image_Library/Website_images/ [apimg1...]
pray tell me where I'd gone wrong.
thanks alot