Jump to content

Doing a Proper 404


goodespeler

Recommended Posts

		if (!file_exists($this->section.'/includes/head/'.$this->page.'_head.php'))
  	{	
			header("HTTP/1.0 404 Not Found");
			header("Location: http://".$this->domain."/404/");
  	}	

 

I'm trying to do a 404, but I don't think this is the proper way since once the redirect happens, the 404 header goes away. Any thoughts on how to do a proper 404?

Link to comment
https://forums.phpfreaks.com/topic/98982-doing-a-proper-404/
Share on other sites

I can't just include the script since it's an entire page.

 

Here's what I'm doing. I have my site setup to rewrite the url like this http://domain.com/section/page

 

I'm trying to make it so that if I can't find the $page (/page), give the user a 404. If I just included the 404 page, I'd be including a page within a page.

Link to comment
https://forums.phpfreaks.com/topic/98982-doing-a-proper-404/#findComment-506539
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.