Hi,
I know this isnt strictly a php question but considering we all use php it would be fair to assume we all use apache server and mod_rewrite in some form.
I have a website setup on my home linux server under a virtual host directive I created for example:
This is what my hosts file looks like under /etc/hosts
127.0.1.2 Myvirtualhost
So after do the mundane stuff like creating my new vhost file and vhost block within that it was time to test my website locally. For the record the website works great in the public domain.
I have a .htaccess file with the following mod_rewrite rule:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^host/([\w]+) /index.php?p=$1 [L]
Again this is being used on the web as normal with no issues.
Locally on my server its a different matter. The mod_rewrite is working coz its pulling the content pages as it should be using the designated url for example http://www.mysite/folder/friendlyurl/
But!........
It doesnt pull my header and footer files. This the structure of my index.php and directory to give you some idea:
index.php:
include($_SERVER['DOCUMENT_ROOT'].'/include/header.php');
include($_SERVER['DOCUMENT_ROOT'].'/include/leftnav.php');
include('host/'.$page.'.php');
include($_SERVER['DOCUMENT_ROOT'].'/include/rightnav.php');
include($_SERVER['DOCUMENT_ROOT'].'/include/footer.php');
With the normal $page get statements at the top.
Directory:
index.php
/include/header.php
/include/leftnav.php
/include/rightnav.php
/include/footer.php
So does anyone know why it wont include my headers and footer correctly?:queasy: