If you have a CMS that has unfriendly URLs such as “/?id=6785″, or similar, you could use this little tip.
Add a .htaccess to trap 404s (missing pages). chmod it to 644. In it, place this: “ErrorDocument 404 /404.php”
Now, for the interesting part. The following script assumes your table is called ‘pages’, your database connection script is held in ‘.htDB.php’, and stuff. Read it to figure out more.
<?
$contact='kverens@contactjuggling.org';
include('.htDB.php');
$r=preg_replace('/^\//','',$_SERVER['REQUEST_URI']);
$r=preg_replace('/\?.*/','',$r);
$r=addslashes(urldecode($r));
$q=mysql_query('select id from pages where name="'.$r.'"');
if(!mysql_num_rows($q)||ereg('/',$r)){
mail($contact,'[yoursitename.test] missing page',
$_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI']."\nfrom: ".$_SERVER['HTTP_REFERER']);
header('Location: /');
exit;
}
header('Status: 200 OK');
$r=mysql_fetch_array($q);
$id=$r['id'];
include('index.php');
?>
Note that this grabs the page’s ‘id’ from teh table. If you use a different scheme, then obviously, you’ll need to amend this.
674 http://www.onlinepoker-i.com
http://www.poker-w.com
http://www.texas-holdem-big.com
167 I like it like that. ewqrb2
5659 I like it like that. ewqrb2
6324 ya know eredclips
910 get eraaced man
5299 phentermine.one-phentermine.com
adipex.one-phentermine.com
tramadol.one-phentermine.com
ambien.one-phentermine.com
cialis.one-phentermine.com
viagra.one-phentermine.com
diet-pills.one-phentermine.com