Hi All, I’m working on a virtual server in htdocs and my site was’nt pulling its includes, I tool a look and it seems my site rel links ‘/links’ are not running sitewide.
<?php include “/includefiles/websitefooter.html”; ?> not working, <?php include “includefiles/websitefooter.html”; ?> without slash does work however I don’t want to have releative links I want to set all links from the url, do I need to set the root or something? maybe its looking at the root of the server not root of the webspace where domain points in? thanks
Apache looks to its root before looking to the Virtual Host’s DocumentRoot.
If you’re using htdocs as your DocumentRoot, you’re not using Virtual Hosts (learn to do so, it’s fantastic … if you’re a webmaster) so the question to you becomes "Where are links and include files located relative to htdocs?
Another hint: Wrap the include value within parentheticals as include is a PHP function.
I’m sorry, but it’s not. include is a language construct (like require, echo, exit, etc) and does not need parentheses, although you can use them if you like.