Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Custom 404 Page

 

 


theclicklab
User

Dec 15, 2011, 9:29 AM

Post #1 of 2 (159 views)
Shortcut
Custom 404 Page Can't Post

Hi there, I need to setup a custom 404 page

I see that I can change this:


Code
if (!$pagesRecord) { dieWith404("Record not found!"); }


to something like this:


Code
  if (!$your_tableRecord) { header("Location: http://www.mysite.com/"); exit; }


But I still want to pass a 404 header - How would I do this?

Many Thanks
~~~~~~~~~~~~~~~~~~
Jan Dunlop
theClickLab.com
nz.linkedin.com/in/jandunlop
~~~~~~~~~~~~~~~~~~


Jason
Staff / Moderator


Dec 15, 2011, 11:03 AM

Post #2 of 2 (155 views)
Shortcut
Re: [theclicklab] Custom 404 Page [In reply to] Can't Post

Hi Jan,

You can do the redirect to a custom 404 PHP page, then at the top of that page, send the 404 header like this:


Code
<?php 
header("HTTP/1.0 404 Not Found");
?>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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