IW. Can I replace undefined index response with a 404 error?

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 16, 2012   (RSS)

Re: [Jeffncou] IW. Can I replace undefined index response with a 404 error?

By Jason - July 13, 2012

Hi,

I took a look through the Instant Website code, and in webiste_inti.php there is this block:

// show error message if no matching page is found
if (!$page) {
header("HTTP/1.0 404 Not Found");
print "<h1>404 Not Found</h1>";
exit;
}


This should give a 404 error when a page has not be retrieved. Could you give an example link to a page where you get the "Unidentified Index" error?

Also, so can change the message in the code at this point, or put in a redirect if you like.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] IW. Can I replace undefined index response with a 404 error?

By JeffC - July 13, 2012 - edited: July 15, 2012

Hi Jason

The block of code you posted wasn't in my website_init.php. Maybe I have a earlier version of the addon or maybe I removed it by accident. Either way adding this code makes everything work. Thanks for your help.
Jeff

Re: [Jeffncou] IW. Can I replace undefined index response with a 404 error?

By Jason - July 16, 2012

No problem. Glad to hear everything is working now.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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