You are already getting the content from a recordset, so you just have to look to see if there is a result and redirect if there isn't. I added this code below the recordset:
<?php
if (!$row_rsSurveys){
header("location: https://www.vetprofessionals.com/site/404");
die();
}
?>