Forum Moderators: phranque
I have two sites on the same server: siteA and siteB. An image folder (huge, nested structure) inside the root of siteA is going to be duplicated into the identical relative location inside of siteB. I figured that instead of actually duplicating the image folder, I could internally rewrite requests for siteB images into siteA's image folder. Yet, it does not seem to be working.
This is what I am using in .htaccess in /www/hosts/siteB/images/project/
RewriteEngine On
RewriteBase /images/project/
RewriteRule ^(.+)$ /www/hosts/siteA/images/project/$1 [L]
When I try to access siteB.tld/images/project/sample.gif I get a 404 with the curious:
The requested URL /www/hosts/siteA/images/project/sample. gif was not found on this server.
Can I rewrite from inside one DocumentRoot into a different one? Is there a better way to accomplish this? Am I making any sense? :)
The other -much less efficient- way to cross over is to proxy the destination directory through the server receiving the request (In this case, the destination serve actually has the image, and requests for that same image sent to the other server are passed through to it via a new HTTP request.)
Jim