I have copied most of a php website to my local computer for debugging and development. There is a HUGE number of images on the original remote website that I cannot transfer. The same images are served by two different domain names on the same server so I want to get going by mapping first_domain.com
to 127.0.0.1
in /etc/hosts
and configure Apache (latest, greatest version) to pull the /images/*/*
from second_domain.com/images/*/*
Configuring /etc/hosts
was easy. But I do not know what I am doing wrong in configuring Apache.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
#...
# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
In conf/extra/proxy-html.conf
, in addition to defaults:
ProxyRequests Off
ProxyPass /properties/ http://newhawaiiproperties.com/properties/
<Location /properties/>
ProxyPassReverse /
ProxyHTMLEnable On
ProxyHTMLURLMap http://newhawaiiproperties.com/properties/ /properties/
ProxyHTMLURLMap / /properties/
</Location>
Should I change ProxyRequests Off
to ProxyRequests On
?
update: I am realizing I do not need to change the HTML files, they are all jpgs so I should be able to get rid of ProxyHTML...
stuff.
I was overthinking/overconfiguring it it. The following worked.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyPass /foo http://second_domain.com/foo
ProxyPassReverse /foo http://second_domain.com/foo
No wildcards or freaking rewriting needed! It sends everything like /foo/bar/x.jpg
to http://second_domain.com/foo/bar/x.jpg