Hi I have shared hosting account with two subfolders for each domain. Domain B is test(beta) page where i do new stuff before i publish it on site A. Site A and B have same database where i store file names of photo. I want to access photos that are on site A from domain B ex. Get /public_html/A/photos/sample.jpg (http://A.com/photos/sample.jpg) by entering url http://B.com/photos/sample.jpg
Not sure if this will work in htaccess. If not put it in your Apache conf file. First try it in htaccess on site B. Alias /A/photos /home/httpd/siteB/public_html/A/photos Re's Rob Whisonant
Because both domains are hosted on the same server under your account. You want to grab photo from B, and display it to A. : Create a PHP file (e.g. display.php) in A, Read the file content from B's real path with fopen or any file reading method, store the content in a variable (e.g. $fileContent). Echo the header in display.php with related content type. For example. header('Content-type: image/gif'); PHP: Echo the file content. $fileContent PHP: Now when a user opens display.php in A, the B's photo will be displayed. Now you must make a mod rewrite so that the user opens display.php as display.jpg, display.gif or any alias that you like If A and B are not hosted in the same server, read the B's photo with cURL.
Figured it would help if I explained this in a little more detail. Alias /A/photos /home/httpd/siteB/public_html/A/photos The line above assigns an alias to the file path. So. http://www.sitename.com/A/photos/image1.jpg and http://www.sitename2.com/A/photos/image1.jpg Are both using the images in folder /home/httpd/siteB/public_html/A/photos Re's Rob Whisonant