You can throw the $_GET you use into an array, and then check the query string (ie. domain.com/?this) against it, like this:
$pages = array("home","downloads","donate","links","contactme");
$queries = split('[=.&]',$_SERVER['QUERY_STRING']);
// If $queries[0] is not in our array
if (!(in_array($queries[0],$pages))){
include('error.php');
}
// If $queries[0] is in our array, include file according to GET
elseif (in_array($queries[0],$pages))
{
if(isset($_GET['home'])){
include('main.php');
}
elseif(isset($_GET['downloads'])){
include('downloads.php');
}
elseif(isset($_GET['donate'])){
include('donate.php');
}
elseif(isset($_GET['links'])){
include('links.php');
}
elseif(isset($_GET['contactme'])){
include('contact.php');
}
else{
include('main.php');
}
}