php - Access files in other domain -


very easy, have:

domain1.com domain2.com

set on cpanel/whm dedicated server

i want access image domain1.com domain2.com without using full http route

instead of this

<img src="http://www.domain1.com/files/image1.jpg" />

i want this:

<img src="../../domain1/public_html/files/image1.jpg" />

how do this?

it can done... if both domains on same server.

on linux/bsd (or *nix) server set create symbolic link in domain2 www directory actual directory in domain1.

if use apache, might able redirect requests transparently using .htaccess. bit more difficult , may not work on apache installations.

with both these solutions you'll end url's make domain1 subdirectory of domain2. example:

<img src="/domain1/files/image1.jpg" /> 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -