I am attempting to create a custom 404 page that redirects the user to a search result based on what the script thinks they were looking for. I have everything set up and it all works great, except for one thing.
I would like to have all the configuration performed externally, including the path to the search script. So, for instance, if my search script is in the "search" subfolder on my hosting account, the configuration (settings.php) would say something like:
Code: Select all
<?php
define( "_DOMAIN_", "www.example.com" );
define( "_SEARCHPATH_", "/search/" );
?>Code: Select all
<?php
$r = $_SERVER['DOCUMENT_ROOT'] . "/path/to/settings.php";
require( $r );
?>Oh, and if I echo $r, it gives me the correct full path (/home/tarview/public_html), so I know that part should be fine. Or is it? Could I be missing something there?