Having a bit of an issue with absolute/relative urls. I have MAC running OS 10.5.4, Apache 2.2, PHP 5.2.5, MySQL 5.0.67 and phpMyAdmin 2.11.8.1.
Things work great, it took me a while, but I finally have all of these apps running soundfully with each other and can develop nicely. I am, however, running into an issue which I would like some help with.
I will first list my vhost settings and any other pertinent information that could help this process.
Here is the document root in my http.conf file:
DocumentRoot "/Library/WebServer/Documents"
Here are important settings in the httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "/Users/CDB/Sites"
</VirtualHost>
#IndieViz Local Site
Listen 1001
<VirtualHost *:1001>
DocumentRoot "/Users/CDB/Sites/indieViz/httpdocs"
ServerName 10.0.1.182:1001
</VirtualHost>
<Directory /Users/CDB/Sites/indieViz/httpdocs>
Allow from all
</Directory>
Ok, now on to my issue:
I access my development site listed at 10.0.1.182:1001 and in the index.php page are the following lines
include("/include/lib.php");
<img src="/img/banner_contest_269x195.jpg" width="269" height="195" border="0">
When the page is served, it cannot find the /include/lib.php but it CAN find the /img/banner... file.
There is both an img folder and an include folder in the httpdocs dir (the ROOT dir). So, what is the reason that /include doesn't resolve to the root, but /img does? The reason I need /include to work is that this file is included on many files deep within the site structure. I really don't want to type in ../../include and ../include every time I want to include this file, so, any help would be greatly appreciated.
I hope this makes sense, if not, please ask, I will try my best to explain.
Thanks for any help,
Clay