Skip to main content
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
panneer
New

Unable to access images from one subdomain to another subdomain

Unable to access image files from one subdomain to another subdomain.  Images are accessed through PHP program.  The following is the PHP code:

 

$bgimage = $image_name;

$imagesDirectory = "../subdomain1.mywebsite.com/bgimages/";

if(is_dir($imagesDirectory))

{

$opendirectory = opendir($imagesDirectory);

$imgFileType = pathinfo($bgimage,PATHINFO_EXTENSION);

echo $imgFileType;

if(($imgFileType == 'jpg') || ($imgFileType == 'jpeg'))

{

echo "<img src='$imagesDirectory/".$bgimage."' width='500' length=250 galleryimg=no> ";

}

    closedir($opendirectory);

 

}

else

{

echo "<p>Photo Image Not available!!?? ";

}

 

Can you help?

1 ACCEPTED SOLUTION
PL281
Super User IV

@panneer 

 

So based on code you have there 

You would have   src="../subdomain1.mywebsite.com/bgimages/IMAGENAME" which is not a valid URL for the source 

 

You would need to a symbolic link on the server to get this to work correctly in this format

I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

View solution in original post

1 REPLY 1
PL281
Super User IV

@panneer 

 

So based on code you have there 

You would have   src="../subdomain1.mywebsite.com/bgimages/IMAGENAME" which is not a valid URL for the source 

 

You would need to a symbolic link on the server to get this to work correctly in this format

I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

View solution in original post