Replace "Record not found!" with custom 404 Page not Found

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 28, 2015   (RSS)

By Damon - April 27, 2015

Hi Andy,

In your listingDetail.php template, replace the "Record not found!" code with a redirect to your 404 page.

Find this code:

if (!$newsRecord) { dieWith404("Record not found!"); } // show error message if no record found

Replace with this code:

if (!$newsRecord) { header('Location: http://www.comparedirect.eu/404-compare-direct.php'); } // redirect to 404 page


Hopefully this is what you were after!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By andybarn - April 28, 2015

Hi Damon

Fantastic, that did the trick!

Thanks for the great support and help.

Kind regards
Andy