You are here:  » Custom 404 page

Support Forum



Custom 404 page

Submitted by teezone on Sun, 2010-08-15 21:31 in

Hi David, hope all is well!

I've made some changes to the $banner["h2"] text in products.php, but is there away to redirect this to a custom 404 page?

Thanks
T.

Submitted by support on Mon, 2010-08-16 09:00

Hi,

I'm assuming that you have modified this code in products.php

      header("HTTP/1.0 404 Not Found");
      $banner["h2"] .= "(".translate("product not found").")";

However, for correct 404 protocol, I would recommend including your custom 404 page after the 404 Not Found header has been sent; for example:

      header("HTTP/1.0 404 Not Found");
      require("404.php");
      exit();

Create your 404.php page (in your Price Tapestry installation folder), and if required you can make it include your standard header and footer, e.g.

404.php

<?php
  $header["title"] = "Not Found";
  require("html/header.php");
?>
<!-- your custom 404 HTML body here -->
<?php
  require("html/footer.php");
?>

Cheers,
David.
--
PriceTapestry.com