Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding an image for a custom 404 page

Adding an image for a custom 404 page

Views: 1,797

Results 1 to 6 of 6
9 May 2012, 2:42 PM
#1
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Adding an image for a custom 404 page

I'm trying to add an image to my template's page_not_found.php page. All I want to do is add a simple <img> tag to this:

<?php 

header("HTTP/1.1 301 Moved Permanently");
header("Location: index.php?main_page=page_not_found");


?>

I edited the .htaccess page to point to this page already.

Thanks

10 May 2012, 4:09 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Adding an image for a custom 404 page

thebigkick:

I'm trying to add an image to my template's page_not_found.php page. All I want to do is add a simple <img> tag to this:

<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: index.php?main_page=page_not_found"); ?>

Can't be done.  This 'page' is never displayed.  Assuming you have zencart set to display the 'page not found' page (My Store ->missing page check) then the file you'll need to edit woud be /includes/modules/pages/page_not_found/header_php.php  

> **thebigkick:**
>
> I edited the .htaccess page to point to this page already.

I'm not sure why you needed to do this? 

Cheers
Rod
22 May 2012, 4:27 PM
#3
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: Adding an image for a custom 404 page

Ok. I definitely need direction on this. All I'm trying to do is have an image show up that indicates a 404 error. And have that image link to the home page.

Would I be wrong in saying that there are two (2) 404 pages; Zen cart's internal 404 and an external 404?

i was originally following this: http://www.zen-cart.com/showthread.php?190780-Custom-Page-Not-Found-Is-Not-Working&highlight=custom+404+page

22 May 2012, 4:42 PM
#4
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: Adding an image for a custom 404 page

So I edited define_page_not_found.php in the Define Pages Editor under the Admin. Worked perfectly. (Another case of making things more complicated than it needs to be.)

Just interested in editing the external 404 page that the server throws up. I guess this isn't ZC specific but I'll post the solution when I find it.

22 May 2012, 7:48 PM
#6
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: Adding an image for a custom 404 page

Ok here is what I did. Pretty simple.

  1. Created and customized notfound.html, and placed it in the same directory as .htaccess.
  2. Went to .htaccess and entered
ErrorDocument 404 /notfound.html
  1. Saved and uploaded both to the server.

Custom Apache server 404 page.