file_exists on different subdomain?

Hello. I have 2 subdomains on my server, each running 1 side of a 2 part system. I don’t want to duplicate images across these 2 subdomains, so 1 site pulls its images from the other. That all works fine, except for if the image doesn’t exist. Is there any way for me to check if the file exists before i send it to the resizer (where getimagesize will generate an error)? Is there a way to link to files across subdomains, or do a file_exists() check? I tried “…/blah/blah” but that didn’t work…

Any suggestions would be greatly appreciated!


If the two subdomains are served from the same machine, you could just use the internal path in a file_exists() check.

They are served on the same server, and i’m trying to use file_exists. It’s a path issue, i guess. I’ve tried:

example: trying to use file_exists() on sub1:


but none of that has worked…

How about /home/public_html/sub1/images/myfile.jpg?

ahhh… i found it, there was a user name between home and public_html.

Thanks for your help!!

Sponsor our Newsletter | Privacy Policy | Terms of Service