Forum Moderators: coopster
Instead of manually writing them as:
if ($_GET['result']) =="")
require('404.php'):
} How can I catch them all at once... basically, if the $_GET pulls no data, throw a 404 regardless of what's in the query string. Some of the query strings only changed the content of the html, not all of them were pulling data from databases so counting rows won't necessarily do the trick.
Is it possible?
How can I catch them all at once... basically, if the $_GET pulls no data, throw a 404 regardless of what's in the query string.
I'm not quite sure I understand... if $_GET has no data (ie. empty($_GET)==true) then there is no query string? Or, are you wanting to just check 1 value, ie.
if (!isset($_GET["result"])) {// result is not present}?
Set up an external redirect to the canonical URL (301), or a rewrite to an internal filepath that does not exist (404), if the query string is not blank.
The redirect will preserve incoming traffic from external links as well as at least partially transfer any PageRank benefit too.