|   « Previous Blog | Next Blog »   |
|   ← COVID-19 | My Transit Van fo .. →   |
| Article created:- | February 22, 2023 9:18 am |
| Last modified:- | September 20, 2024 4:58 pm |
Written by:- MJS
Having real fun with a great many 404s being generated on my site of late.
I’m being informed of the missing URLs, because of this PHP code that I placed inside my own 404.PHP file.
<?php
$adminemail = get_option( 'admin_email' );
$website = get_bloginfo( 'url' );
$websitename = get_bloginfo( 'name' );
if ( !isset ( $_SERVER[ 'HTTP_REFERER' ] ) )
{
// left blank ..
}
elseif ( isset( $_SERVER[ 'HTTP_REFERER' ] ) )
{
$failuremess = 'Heads up!<br />A user tried to go to $website ..<br /> [ ';
$failuremess .= $_SERVER[ 'REQUEST_URI' ] . ' ] <br />';
$failuremess .= ' .. And received a 404 (page not found) error. <br />';
$failuremess .= 'It (probably) twernt their fault: so try fixing it, they came from ..<br /><br /> [ ';
$failuremess .= isset( $_SERVER[ 'HTTP_REFERER' ]) ? $_SERVER[ 'HTTP_REFERER' ] : 'Taz been spoofed' . ' ] <br />';
wp_mail( $adminemail, "Bad Link To " . $_SERVER[ 'REQUEST_URI' ], $failuremess, "From: $websitename <noreply@$website>");
}
?>
No rems included, and I’m sorry if you can’t read it: not! – My advise – LEARN (!!!) – And then stop whinging!
Most of the reported errors are the results are from the poxy little minded “script kiddies” banging out their corrupt URLs; gleaned (then twisted) from my own site paths I might add, but some are from the main crawlers themselves.
Currently installed a plugin called:-
Which then promptly displays the following, ..
Search engines haven’t been notified yet
SO! – Here’s a new post to hopefully trigger this plugin, complete with standard links.
|   « Previous Blog | Next Blog »   |
| ← COVID-19 | My Transit Van fo .. → |
writeOn - © 2026 Download this theme.
localStorage Cookie info. This website uses simple cookies, and even simpler localStorage structures. (Enabling dynamic functionality.) They are not used for any other sort of nefarious sales techniques.
To view this book site, you must be considered as an ADULT (with legal consent) in your current location to proceed any further. Failure to comply, could result in a criminal prosecution (within the local domicile) that you physically reside.
Theses web-pages aren't for children, nor any childish attitudes towards sexual ambivalence.
It is for -- ADULTS ONLY!
Pressing [ No! ] - Will take you away, to another type of less salubrious activity, that's obviously more suited to your young tender age (and/or) delicate disposition.
Only press [ YES! ]
if you understand the terms. After that, a one year cookie will be set on your browser, thusly declaring you to be an adult, (a constitutional time-Warrior), with all of your timely facilities intact.
It's a big decision that you're about to undertake, choose wisely: because you can never go back.