Okay, so we’re running Apache on a shared hosting server, along with Perl and PHP. But since it’s shared, I don’t have access to the global configuration files of these services. Right now, my site is located at:
There are certain parts of my site that will remain constant across a large subset of pages, like my header and footer. I’d like to place these into each page by using a PHP include directive, like:<? include("/templates/banner.php") ?>
The only problem here is that “/” is interpreted to be the server root “/”, not the site root “/home/.servername/username/mysite.com”, as I’d prefer. Some people have suggested using PHP’s $DOCUMENT_ROOT environment variable, but that seems like a kludge. I’d really prefer to tell Apache directly to rewrite my site root accordingly, say, by using the DocumentRoot directive.
Is there anything I can do, or do I need to resort to a hackish solution? Any help would be greatly appreciated. Thanks!