I acquired 2 sub-domain names

c:wampwwwwebsiteA - http://websiteA/

c:wampwwwwebsiteB - http://websiteB/

inside websiteA got a folder for storing picture


so as websiteB wish to access websiteA photo in websiteB's html I must do link like

url: http://websiteB/1.html

<img src="http://websiteA/photos/1.jpg" />

the issue is I'd rather not expose websiteA domain in websiteB, since two domain is inside one machine. Can you really achieve something similar to virtual host?

I additionally don't wish to expose the physical path for websiteA, and don't wish to duplicate the information.

I'm thinking make a move in websiteB .htaccess?

Transpire is within websiteB html in a position to display photo by using it own domain,

<img src="http://websiteB/photos/1.jpg" />

Edit: I believe the question request it this strategy is better so as user request http://websiteB/photo/1.jpg, the after sales really request the file from http://websiteA/photo/1.jpg, any idea do from .htaccess?

I'm new in htaccess, I attempted inshtaccess, although not success

RewriteEngine On
RewriteRule http://websiteA/photos/1.jpg http://websiteB/photos/1.jpg[NC,L]

Thank You!!!

PS: Solution have to work either home windows / linux atmosphere.

On Home windows it is dependent on which filesystem you are using. NTFS: http://en.wikipedia.org/wiki/NTFS_symbolic_link FAT32 does not support symlinks.

Seem doggy? Are you able to supply reason?

What you're most likely searching for is really a proxy. Take a look on the internet

I believe I received my solution, unsure is ideal or otherwise inside .htaccess for websiteB

RewriteEngine On
RewriteBase /websiteB/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^photos/(.*)$ http://websiteA/$1 [L]

the one thing I discovered it not too perfect happens when I enter http://websiteB/photos/1.jpg, it'll redirect to http://websiteA/photos/1.jpg

but within the HTML, I type

<img src="http://websiteB/photos/1.jpg" />

It in a position to load http://websiteA/photos/1.jpg without alter the URL. That's look Suitable for me.