I need assistance solving a problem.
I have hundreds of webs in a web system I'm designing, and all of them use the same index.php file on the server:
/home/www/index.php
So, if you would visit one of those web sites (http://www.bla.com/index.php) you would display that php file.
However, I cannot have all the images and other stuff stored in that same directory (/home/www/images, etc.) because there are so many other web sites.
So, I created on the server a directory for all web sites:
.
..
index.php
www.bla.com/
www.fleh.com/
www.blahhh.com/
and under each of those directories, I created /images.
Ok, but now I have to point to an image in my index.php code like this:
<img src="www.bla.com/images/myimage.png">
But this is not what I want. I want to create a symbolic link that directs /home/www/images/ to /home/www/$HTTP_HOST/images/
So, it would depend on the enviroment variable what images directory to use.
I know that PHP has the host address stored in a enviroment variable called $HTTP_HOST, can I use it in this manner?
I doubt, but how would work around this problem? 🙂