Hi,
I have this basic template parsing script for my home page, but have a slight problem with it. The script is simply as follows:
if ($page=="") {
include("default");
} else {
include("$page");
};
If there is no 'page=' in the URL, it parses the file 'default', which is the home page.
However, I want the script to display a 404 type page/message should a page in the URL not exist.
i.e. If for whatever reason http://www.mydomain.com?page=about didnt exist, instead of having Warning errors - would it be possible to trap the errors and redirect to index.php?page=404 or something?
The errors I get (within the template) at the moment are:
Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/mydomain.com/test/index.php on line 56
Warning: Failed opening 'about' for inclusion (include_path='.:/usr/share/php') in /home/httpd/vhosts/mydomain.com/index.php on line 56
Thanks.