Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Page Not Found override not working for me

Page Not Found override not working for me

Locked

Views: 14,007

Results 1 to 20 of 43
This thread is locked. New replies are disabled.
19 Sep 2006, 9:27 PM
#1
spinner avatar

spinner

New Zenner

Join Date:
Feb 2006
Posts:
39
Plugin Contributions:
0

Page Not Found override not working for me

Hi all,

I'm running 1.3.5 and all seems to be working fine. However, I'm now trying for the first time to actually get the page_not_found.php to work; unfortunately my override for define_page_not_found.php doesn't seem to have any effect on what is actually displayed. The Define Pages Editor shows my edited HTML code, but the site still doesn't show it when I open http://www.beebasic.co.uk/store/page_not_found.php.

Can anyone help?

Thanks!

Spinner

19 Sep 2006, 9:51 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

you might want to add this using phpMyAdmin:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('Define Page-Not-Found Status', 'DEFINE_PAGE_NOT_FOUND_STATUS', '1', 'Enable the Defined Page-Not-Found Text from define-pages?<br />0= Define Text OFF<br />1= Define Text ON', '25', '67', now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\'),');
25 Sep 2006, 12:16 PM
#3
spinner avatar

spinner

New Zenner

Join Date:
Feb 2006
Posts:
39
Plugin Contributions:
0

Re: Page Not Found override not working for me

Hi DrByte,

Thanks for that - that worked fine! However, how can I edit the list of page links that appears beneath my text? In fact, how can I edit my Site Map in the same way? It currently shows "Page 2", "Page 3" and "Page 4" in the list.

Thanks again,

Spinner

25 Sep 2006, 12:29 PM
#4
spinner avatar

spinner

New Zenner

Join Date:
Feb 2006
Posts:
39
Plugin Contributions:
0

Re: Page Not Found override not working for me

Just read the Define Page Status page more carefully and managed to turn off the unwanted links - I should have noticed that before! However, could you tell me how I can modify the Site Map link list, adding links and generally beautifying it? Is such a things possible?

Thanks!

26 Sep 2006, 5:55 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

You can edit your site map by modifying your customized template file at:
/includes/templates/YOURTEMPLATE/templates/tpl_sitemap_default.php

1 Dec 2006, 10:05 PM
#6
namsingh avatar

namsingh

Zen Follower

Join Date:
Sep 2006
Location:
Leeds, UK
Posts:
165
Plugin Contributions:
0

Re: Page Not Found override not working for me

I have had this problem since i upgraded to 1.3.5 i did the fixes but my page still not working! All other define pages work fine. Any ideas?

2 Dec 2006, 11:52 AM
#7
namsingh avatar

namsingh

Zen Follower

Join Date:
Sep 2006
Location:
Leeds, UK
Posts:
165
Plugin Contributions:
0

Re: Page Not Found override not working for me

Finally found the problem!!!!

I have installed the SEO URL Re writing mod and it places a .htaccess file on the root. I think this is over riding the Error 404 Document.

I simply added the following line at the top and it works fine!

ErrorDocument 404 /page_not_found.html

30 Dec 2006, 8:21 AM
#8
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: Page Not Found override not working for me

I just found the switches for turning on my "page not found" in admin config- My store -Missing page check.

And switched the setting in the Admin - Config - Define Page-Not-Found Status.

I put some text in the define page area and with a test it showed up.

Now I see the site map is added below my text. But the EZ pages are not showing up.

You can edit your site map by modifying your customized template file at:
/includes/templates/YOURTEMPLATE/templates/tpl_sitemap_default.php

I had already done the prior code patch for EZ pages and they do show up on the actual site map but not in this define_page_not_found site map.

Did I miss something or is there a way to make them work the same?

6 Aug 2008, 10:07 PM
#9
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

I looked in the forum but couldn't find explanation...
I'm using ZenCart 1.3.7, windows server (so .htaccess file won't work for me)

My page_not_found.php will not show up when trying to access a non existing product or path. I'm getting a standard default server 404 page like this one:
http://www.rid.org/666

In Admin Config I have in MY Store Missing Page Check set to Page Not Found and under Define Pages Missing Page set to "display text".

Page_Not_Found is editable in Define Pages Editor but will not show up in place of the default 404 page...

Please help me understand how it is supposed to work.

7 Aug 2008, 6:49 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

sillygrl1212:

I looked in the forum but couldn't find explanation...
I'm using ZenCart 1.3.7, windows server (so .htaccess file won't work for me)

You'll have to talk to your hosting company for instructions on how to change the default behavior of the 404 page on your particular windows server.

You'll want to point it to something like one of the following:
http://www.MYSITE.COM/page_not_found.php
or
http://www.MYSITE.COM/index.php?main_page=page_not_found

Your hosting company should be able to tell you how to do it, or if they don't let you do it yourself, then they should be able to do it for you.

8 Aug 2008, 1:10 AM
#11
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

DrByte:

You'll have to talk to your hosting company for instructions on how to change the default behavior of the 404 page on your particular windows server.

You'll want to point it to something like one of the following:
http://www.MYSITE.COM/page_not_found.php
or
http://www.MYSITE.COM/index.php?main_page=page_not_found

Your hosting company should be able to tell you how to do it, or if they don't let you do it yourself, then they should be able to do it for you.

Thanks. I was able to do it on the server. After I changed the server default for 404 page to page_not_found.php I was no longer getting a standard 404 page and server redirected to URL for my page_not_found.php but it never loaded. I tested this setup with an index.php page and it worked so it looks I got the ser4ver part right. Contents of my page_not_found.php page located in root directory:
<?php
/**

  • Handler for page not found errors
  • Generates a 301 Moved permanently error and redirects to index.php?main_page=page_not_found
  • Especially useful as for Google indexing
  • @package general
  • @copyright Copyright 2003-2005 Zen Cart Development Team
  • @copyright Portions Copyright 2003 osCommerce
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: page_not_found.php 2742 2005-12-30 21:12:44Z wilt $
    /
    /
  • redirect to the page_not_found page after sending spiders the "moved" message
    */
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: index.php?main_page=page_not_found");
    ?>

Admin settings (I tried all of the options) are set to "Page Not Found" under My Store andf to "1" display text on under Define Pages.

Any other settings I need to adjust to have the page_not_found.php display?

8 Aug 2008, 6:21 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

What happens if you point your browser to your page_not_found.php file directly?

What is your store URL?

Is it located in a subdirectory? Maybe you need to alter the redirect URL to accommodate your subdirectory?

8 Aug 2008, 8:52 PM
#13
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

No, the store is located in main directory (root). When I changed the server's default 404 error page to page_not_found.php the browser keeps attempting to display it but the browser window is blank indefinitely - no error is displayed.

For test I changed the default server 404 error page to either index.php or define_checkout_success.php (both located in root directory wher the page_not_found.php resides and both (index.php or define_checkout_success.php) display successfully without any delay.

This leads me to suspicion that I got it right on the server side and it is just the page_not_found.php not loading for some reason...

8 Aug 2008, 10:26 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

If you go to page_not_found.php directly from your browser, do you get a blank page still?
If you do, then perhaps the file is damaged and you're getting a PHP error. Reloading the file may help.

9 Aug 2008, 12:03 AM
#15
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

DrByte:

If you go to page_not_found.php directly from your browser, do you get a blank page still?
If you do, then perhaps the file is damaged and you're getting a PHP error. Reloading the file may help.

Yes. The Browser status on the bottom left says "Website located, waiting for...and page_not_found.php path) The browser window either holds the previously displayed page or goes blank. I checked with header checker what it sees when loading the page_not_found.php:
HTTP/1.1 301 OK
Connection: close
Date: Fri, 08 Aug 2008 23:45:15 GMT
Content-Length: 157Content-Type: text/htmlLocation: index.php?main_page=page_not_found
Server: Microsoft-IIS/6.0X-Powered-By: PHP/4.4.1MicrosoftOfficeWebServer: 5.0_PubX-Powered-By: ASP.NET

I removed all override files relating to page_not_found, tried it - still didn't work. Then I replaced the page with the one from original installation. Still didn't work.

I also noticed that changing Admin settings in My Store for Missing Page Check from Page_Not_Found to "ON' or "OFF" doesn't have any effect. I.E. with this setting "on" the ZenCart should direct the misssing or non-existant pages to Index page but it doesn't.

9 Aug 2008, 12:05 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

sillygrl1212:

I also noticed that changing Admin settings in My Store for Missing Page Check from Page_Not_Found to "ON' or "OFF" doesn't have any effect. I.E. with this setting "on" the ZenCart should direct the misssing or non-existant pages to Index page but it doesn't.
That only applies if someone enters index.php?main_page=invalid-page-name-here

9 Aug 2008, 12:07 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

What happens if you go to: index.php?main_page=page_not_found directly?

I'm pretty sure your issue is a Windoze issue

9 Aug 2008, 12:42 AM
#18
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

DrByte:

What happens if you go to: index.php?main_page=page_not_found directly?

I'm pretty sure your issue is a Windoze issue

It just says on the bottom of the browser :"Connecting" and nothing happens.

9 Aug 2008, 1:45 AM
#19
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Re: Page Not Found override not working for me

DrByte:

That only applies if someone enters index.php?main_page=invalid-page-name-here

When I change setting to "OFF" in My Store for Missing Page Check and try to call URL for a non-existing page (/index.php?main_page=666) I get this:

Warning: main(includes/templates/template_default/templates/tpl_666_default.php): failed to open stream: No such file or directory in \includes\templates\iC_AcadameV1.2\common\tpl_main_page.php on line 112

Warning: main(includes/templates/template_default/templates/tpl_666_default.php): failed to open stream: No such file or directory in \includes\templates\iC_AcadameV1.2\common\tpl_main_page.php on line 112

Warning: main(includes/templates/template_default/templates/tpl_666_default.php): failed to open stream: No such file or directory in \includes\templates\iC_AcadameV1.2\common\tpl_main_page.php on line 112

Fatal error: main(): Failed opening required 'includes/templates/template_default/templates/tpl_666_default.php' (include_path='.;c:\php\pear') in \includes\templates\iC_AcadameV1.2\common\tpl_main_page.php on line 112

Does it give any clue?

9 Aug 2008, 2:07 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Page Not Found override not working for me

That's exactly what you should see when you set it to "OFF".

"Off" means to go ahead and display the errors.
"On" means to redirect to home.
"Page Not Found" means to send a 301 header and go to main_page=page_not_found